aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>2019-10-16 17:04:12 +0000
committerbergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>2019-10-16 17:04:12 +0000
commit07df75f896e98aeca99d22b475f4d31079075b15 (patch)
treea0ba1c0ebc44de3e8b4705ab148ad06541b016fe
parentebac15937cc4436cbf7bb5fc96bad2ff52194c84 (diff)
parentf81582795d3b15e6671246315c8be8e6749da083 (diff)
Merge up to 277072.ibm/gcc-7-branch
* REVISION: Update subversion id. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ibm/gcc-7-branch@277075 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog34
-rw-r--r--gcc/ChangeLog.ibm5
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/REVISION2
-rw-r--r--gcc/ada/ChangeLog14
-rw-r--r--gcc/ada/gcc-interface/decl.c16
-rw-r--r--gcc/ada/sem_util.adb21
-rw-r--r--gcc/ada/sem_util.ads17
-rw-r--r--gcc/config.gcc11
-rw-r--r--gcc/config/sh/sh.c8
-rw-r--r--gcc/config/sh/sh.h2
-rw-r--r--gcc/config/sh/sh.md90
12 files changed, 158 insertions, 64 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0c20c87f20a..21f39d74b7d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,37 @@
+2019-10-16 Peter Bergner <bergner@linux.ibm.com>
+
+ Backport from mainline
+ 2019-10-08 Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
+
+ * config.gcc: Move -L usage from LINK_OS_EXTRA_SPEC32 and
+ LINK_OS_EXTRA_SPEC64 to MD_STARTFILE_PREFIX and
+ MD_STARTFILE_PREFIX_1 when using --with-advance-toolchain.
+
+2019-10-11 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport from mainline
+ 2019-10-10 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/88630
+ * config/sh/sh.h (TARGET_FPU_SH4_300): New macro.
+ * config/sh/sh.c (sh_option_override): Enable fsca and fsrra insns
+ also for TARGET_FPU_SH4_300.
+ (sh_emit_mode_set): Check for TARGET_FPU_SH4_300 instead of
+ TARGET_SH4_300.
+ * config/sh/sh.md (toggle_pr): Add TARGET_FPU_SH4_300 condition.
+ (negsf2): Expand to either negsf2_fpscr or negsf2_no_fpscr.
+ (*negsf2_i): Split into ...
+ (negsf2_fpscr, negsf2_no_fpscr): ... these new patterns.
+ (abssf2): Expand to either abssf2_fpsc or abssf2_no_fpsc.
+ (**abssf2_i): Split into ...
+ (abssf2_fpscr, abssf2_no_fpscr): ... these new patterns.
+ (negdf2): Expand to either negdf2_fpscr or negdf2_no_fpscr.
+ (*negdf2_i): Split into ...
+ (negdf2_fpscr, negdf2_no_fpscr): ... these new patterns.
+ (absdf2): Expand to either absdf2_fpscr or absdf2_no_fpsc.
+ (**abssf2_i): Split into ...
+ (absdf2_fpscr, absdf2_no_fpscr): ... these new patterns.
+
2019-10-07 Bill Schmidt <wschmidt@linux.ibm.com>
Backport from mainline
diff --git a/gcc/ChangeLog.ibm b/gcc/ChangeLog.ibm
index 4e5965242d3..d55c8027cbc 100644
--- a/gcc/ChangeLog.ibm
+++ b/gcc/ChangeLog.ibm
@@ -1,3 +1,8 @@
+2019-10-16 Peter Bergner <bergner@linux.ibm.com>
+
+ Merge up to 277072.
+ * REVISION: Update subversion id.
+
2019-10-08 Peter Bergner <bergner@linux.ibm.com>
Merge up to 276707.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index c440771e27d..e6b876ab237 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20191008
+20191016
diff --git a/gcc/REVISION b/gcc/REVISION
index edc13d9cca3..7cd863db835 100644
--- a/gcc/REVISION
+++ b/gcc/REVISION
@@ -1 +1 @@
-[ibm/gcc-7-branch revision 276707]
+[ibm/gcc-7-branch revision 277072]
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 5c39dbc6328..14a5dbca52a 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,17 @@
+2019-10-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/91995
+ * sem_util.ads (Defining_Entity): Remove 2nd and 3th parameters.
+ * sem_util.adb (Defining_Entity): Remove 2nd and 3th parameters,
+ and adjust accordingly.
+
+2019-10-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Really test the
+ sign of the value when deciding to build a NEGATE_EXPR.
+ <PLUS_EXPR>: Remove redundant line.
+ <BIT_AND_EXPR>: Do the negation here.
+
2019-09-23 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Attribute_to_gnu): Test Can_Use_Internal_Rep
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 3a5126ad3da..eb337152bcc 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -8073,9 +8073,8 @@ annotate_value (tree gnu_size)
{
case INTEGER_CST:
/* For negative values, build NEGATE_EXPR of the opposite. Such values
- can appear for discriminants in expressions for variants. Note that
- sizetype being unsigned, we don't directly use tree_int_cst_sgn. */
- if (tree_int_cst_sign_bit (gnu_size))
+ can appear for discriminants in expressions for variants. */
+ if (tree_int_cst_sgn (gnu_size) < 0)
{
tree t = wide_int_to_tree (sizetype, wi::neg (gnu_size));
tcode = Negate_Expr;
@@ -8148,9 +8147,8 @@ annotate_value (tree gnu_size)
&& tree_int_cst_sign_bit (TREE_OPERAND (gnu_size, 1)))
{
tcode = Minus_Expr;
- ops[0] = annotate_value (TREE_OPERAND (gnu_size, 0));
- wide_int op1 = wi::neg (TREE_OPERAND (gnu_size, 1));
- ops[1] = annotate_value (wide_int_to_tree (sizetype, op1));
+ wide_int wop1 = wi::neg (TREE_OPERAND (gnu_size, 1));
+ ops[1] = annotate_value (wide_int_to_tree (sizetype, wop1));
break;
}
@@ -8189,9 +8187,9 @@ annotate_value (tree gnu_size)
Such values can appear in expressions with aligning patterns. */
if (TREE_CODE (TREE_OPERAND (gnu_size, 1)) == INTEGER_CST)
{
- wide_int op1 = wi::sext (TREE_OPERAND (gnu_size, 1),
- TYPE_PRECISION (sizetype));
- ops[1] = annotate_value (wide_int_to_tree (sizetype, op1));
+ wide_int wop1 = wi::neg (TREE_OPERAND (gnu_size, 1));
+ tree op1 = wide_int_to_tree (sizetype, wop1);
+ ops[1] = annotate_value (build1 (NEGATE_EXPR, sizetype, op1));
}
break;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 1a7b6ab92af..d461692807e 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -5203,10 +5203,7 @@ package body Sem_Util is
-- Defining_Entity --
---------------------
- function Defining_Entity
- (N : Node_Id;
- Empty_On_Errors : Boolean := False) return Entity_Id
- is
+ function Defining_Entity (N : Node_Id) return Entity_Id is
Err : Entity_Id := Empty;
begin
@@ -5285,14 +5282,10 @@ package body Sem_Util is
-- can continue semantic analysis.
elsif Nam = Error then
- if Empty_On_Errors then
- return Empty;
- else
- Err := Make_Temporary (Sloc (N), 'T');
- Set_Defining_Unit_Name (N, Err);
+ Err := Make_Temporary (Sloc (N), 'T');
+ Set_Defining_Unit_Name (N, Err);
- return Err;
- end if;
+ return Err;
-- If not an entity, get defining identifier
@@ -5307,11 +5300,7 @@ package body Sem_Util is
return Entity (Identifier (N));
when others =>
- if Empty_On_Errors then
- return Empty;
- else
- raise Program_Error;
- end if;
+ raise Program_Error;
end case;
end Defining_Entity;
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index cfec762dcb3..5a33d467083 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -474,9 +474,7 @@ package Sem_Util is
-- in the case of a descendant of a generic formal type (returns Int'Last
-- instead of 0).
- function Defining_Entity
- (N : Node_Id;
- Empty_On_Errors : Boolean := False) return Entity_Id;
+ function Defining_Entity (N : Node_Id) return Entity_Id;
-- Given a declaration N, returns the associated defining entity. If the
-- declaration has a specification, the entity is obtained from the
-- specification. If the declaration has a defining unit name, then the
@@ -487,19 +485,6 @@ package Sem_Util is
-- local entities declared during loop expansion. These entities need
-- debugging information, generated through Qualify_Entity_Names, and
-- the loop declaration must be placed in the table Name_Qualify_Units.
- --
- -- Set flag Empty_On_Error to change the behavior of this routine as
- -- follows:
- --
- -- * True - A declaration that lacks a defining entity returns Empty.
- -- A node that does not allow for a defining entity returns Empty.
- --
- -- * False - A declaration that lacks a defining entity is given a new
- -- internally generated entity which is subsequently returned. A node
- -- that does not allow for a defining entity raises Program_Error.
- --
- -- The former semantics is appropriate for the back end; the latter
- -- semantics is appropriate for the front end.
function Denotes_Discriminant
(N : Node_Id;
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 9d54bfface5..fb6a2d8e09a 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -4339,14 +4339,12 @@ case "${target}" in
echo "#undef LINK_OS_EXTRA_SPEC32"
echo "#define LINK_OS_EXTRA_SPEC32" \
"\"%(link_os_new_dtags)" \
- "-rpath $prefix/lib -rpath $at/lib" \
- "-L $prefix/lib -L $at/lib\""
+ "-rpath $prefix/lib -rpath $at/lib\""
echo
echo "#undef LINK_OS_EXTRA_SPEC64"
echo "#define LINK_OS_EXTRA_SPEC64" \
"\"%(link_os_new_dtags)" \
- "-rpath $prefix/lib64 -rpath $at/lib64" \
- "-L $prefix/lib64 -L $at/lib64\""
+ "-rpath $prefix/lib64 -rpath $at/lib64\""
echo
echo "#undef LINK_OS_NEW_DTAGS_SPEC"
echo "#define LINK_OS_NEW_DTAGS_SPEC" \
@@ -4359,7 +4357,10 @@ case "${target}" in
echo "#define MD_EXEC_PREFIX \"$at/bin/\""
echo
echo "#undef MD_STARTFILE_PREFIX"
- echo "#define MD_STARTFILE_PREFIX \"$at/lib/\"") \
+ echo "#define MD_STARTFILE_PREFIX \"$prefix/lib/\""
+ echo
+ echo "#undef MD_STARTFILE_PREFIX_1"
+ echo "#define MD_STARTFILE_PREFIX_1 \"$at/lib/\"") \
> advance-toolchain.h
else
echo "Unknown advance-toolchain $with_advance_toolchain"
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 12374eaec6a..5b462bcf09d 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -934,11 +934,13 @@ sh_option_override (void)
if (flag_unsafe_math_optimizations)
{
/* Enable fsca insn for SH4A if not otherwise specified by the user. */
- if (global_options_set.x_TARGET_FSCA == 0 && TARGET_SH4A_FP)
+ if (global_options_set.x_TARGET_FSCA == 0
+ && (TARGET_SH4A_FP || TARGET_FPU_SH4_300))
TARGET_FSCA = 1;
/* Enable fsrra insn for SH4A if not otherwise specified by the user. */
- if (global_options_set.x_TARGET_FSRRA == 0 && TARGET_SH4A_FP)
+ if (global_options_set.x_TARGET_FSRRA == 0
+ && (TARGET_SH4A_FP || TARGET_FPU_SH4_300))
TARGET_FSRRA = 1;
}
@@ -12430,7 +12432,7 @@ static void
sh_emit_mode_set (int entity ATTRIBUTE_UNUSED, int mode,
int prev_mode, HARD_REG_SET regs_live ATTRIBUTE_UNUSED)
{
- if ((TARGET_SH4A_FP || TARGET_SH4_300)
+ if ((TARGET_SH4A_FP || TARGET_FPU_SH4_300)
&& prev_mode != FP_MODE_NONE && prev_mode != mode)
{
emit_insn (gen_toggle_pr ());
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index b13d1b3c943..495dc14e12a 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -69,6 +69,8 @@ extern int code_for_indirect_jump_scratch;
FPU is disabled (which makes it compatible with SH4al-dsp). */
#define TARGET_SH4A_FP (TARGET_SH4A && TARGET_FPU_ANY)
+/* True if the FPU is a SH4-300 variant. */
+#define TARGET_FPU_SH4_300 (TARGET_FPU_ANY && TARGET_SH4_300)
/* This is not used by the SH2E calling convention */
#define TARGET_VARARGS_PRETEND_ARGS(FUN_DECL) \
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 4585c4855c7..46729e7f562 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -9161,7 +9161,7 @@
(xor:SI (reg:SI FPSCR_REG) (const_int FPSCR_PR)))
(set (reg:SI FPSCR_MODES_REG)
(unspec_volatile:SI [(const_int 0)] UNSPECV_FPSCR_MODES))]
- "TARGET_SH4A_FP"
+ "TARGET_SH4A_FP || TARGET_FPU_SH4_300"
"fpchg"
[(set_attr "type" "fpscr_toggle")])
@@ -9389,15 +9389,31 @@
(define_expand "negsf2"
[(set (match_operand:SF 0 "fp_arith_reg_operand")
(neg:SF (match_operand:SF 1 "fp_arith_reg_operand")))]
- "TARGET_SH2E")
+ "TARGET_FPU_ANY"
+{
+ if (TARGET_FPU_SH4_300)
+ emit_insn (gen_negsf2_fpscr (operands[0], operands[1]));
+ else
+ emit_insn (gen_negsf2_no_fpscr (operands[0], operands[1]));
+ DONE;
+})
-(define_insn "*negsf2_i"
+(define_insn "negsf2_no_fpscr"
[(set (match_operand:SF 0 "fp_arith_reg_operand" "=f")
(neg:SF (match_operand:SF 1 "fp_arith_reg_operand" "0")))]
- "TARGET_SH2E"
+ "TARGET_FPU_ANY && !TARGET_FPU_SH4_300"
"fneg %0"
[(set_attr "type" "fmove")])
+(define_insn "negsf2_fpscr"
+ [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f")
+ (neg:SF (match_operand:SF 1 "fp_arith_reg_operand" "0")))
+ (use (reg:SI FPSCR_MODES_REG))]
+ "TARGET_FPU_SH4_300"
+ "fneg %0"
+ [(set_attr "type" "fmove")
+ (set_attr "fp_mode" "single")])
+
(define_expand "sqrtsf2"
[(set (match_operand:SF 0 "fp_arith_reg_operand" "")
(sqrt:SF (match_operand:SF 1 "fp_arith_reg_operand" "")))]
@@ -9487,15 +9503,31 @@
(define_expand "abssf2"
[(set (match_operand:SF 0 "fp_arith_reg_operand")
(abs:SF (match_operand:SF 1 "fp_arith_reg_operand")))]
- "TARGET_SH2E")
+ "TARGET_FPU_ANY"
+{
+ if (TARGET_FPU_SH4_300)
+ emit_insn (gen_abssf2_fpscr (operands[0], operands[1]));
+ else
+ emit_insn (gen_abssf2_no_fpscr (operands[0], operands[1]));
+ DONE;
+})
-(define_insn "*abssf2_i"
+(define_insn "abssf2_no_fpscr"
[(set (match_operand:SF 0 "fp_arith_reg_operand" "=f")
(abs:SF (match_operand:SF 1 "fp_arith_reg_operand" "0")))]
- "TARGET_SH2E"
+ "TARGET_FPU_ANY && !TARGET_FPU_SH4_300"
"fabs %0"
[(set_attr "type" "fmove")])
+(define_insn "abssf2_fpscr"
+ [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f")
+ (abs:SF (match_operand:SF 1 "fp_arith_reg_operand" "0")))
+ (use (reg:SI FPSCR_MODES_REG))]
+ "TARGET_FPU_SH4_300"
+ "fabs %0"
+ [(set_attr "type" "fmove")
+ (set_attr "fp_mode" "single")])
+
(define_expand "adddf3"
[(set (match_operand:DF 0 "fp_arith_reg_operand" "")
(plus:DF (match_operand:DF 1 "fp_arith_reg_operand" "")
@@ -9671,12 +9703,28 @@
(define_expand "negdf2"
[(set (match_operand:DF 0 "fp_arith_reg_operand")
(neg:DF (match_operand:DF 1 "fp_arith_reg_operand")))]
- "TARGET_FPU_DOUBLE")
+ "TARGET_FPU_DOUBLE"
+{
+ if (TARGET_FPU_SH4_300)
+ emit_insn (gen_negdf2_fpscr (operands[0], operands[1]));
+ else
+ emit_insn (gen_negdf2_no_fpscr (operands[0], operands[1]));
+ DONE;
+})
-(define_insn "*negdf2_i"
+(define_insn "negdf2_fpscr"
+ [(set (match_operand:DF 0 "fp_arith_reg_operand" "=f")
+ (neg:DF (match_operand:DF 1 "fp_arith_reg_operand" "0")))
+ (use (reg:SI FPSCR_MODES_REG))]
+ "TARGET_FPU_SH4_300"
+ "fneg %0"
+ [(set_attr "type" "fmove")
+ (set_attr "fp_mode" "double")])
+
+(define_insn "negdf2_no_fpscr"
[(set (match_operand:DF 0 "fp_arith_reg_operand" "=f")
(neg:DF (match_operand:DF 1 "fp_arith_reg_operand" "0")))]
- "TARGET_FPU_DOUBLE"
+ "TARGET_FPU_DOUBLE && !TARGET_FPU_SH4_300"
"fneg %0"
[(set_attr "type" "fmove")])
@@ -9702,15 +9750,31 @@
(define_expand "absdf2"
[(set (match_operand:DF 0 "fp_arith_reg_operand")
(abs:DF (match_operand:DF 1 "fp_arith_reg_operand")))]
- "TARGET_FPU_DOUBLE")
+ "TARGET_FPU_DOUBLE"
+{
+ if (TARGET_FPU_SH4_300)
+ emit_insn (gen_absdf2_fpscr (operands[0], operands[1]));
+ else
+ emit_insn (gen_absdf2_no_fpscr (operands[0], operands[1]));
+ DONE;
+})
-(define_insn "*absdf2_i"
+(define_insn "absdf2_no_fpscr"
[(set (match_operand:DF 0 "fp_arith_reg_operand" "=f")
(abs:DF (match_operand:DF 1 "fp_arith_reg_operand" "0")))]
- "TARGET_FPU_DOUBLE"
+ "TARGET_FPU_DOUBLE && !TARGET_FPU_SH4_300"
"fabs %0"
[(set_attr "type" "fmove")])
+(define_insn "absdf2_fpscr"
+ [(set (match_operand:DF 0 "fp_arith_reg_operand" "=f")
+ (abs:DF (match_operand:DF 1 "fp_arith_reg_operand" "0")))
+ (use (reg:SI FPSCR_MODES_REG))]
+ "TARGET_FPU_SH4_300"
+ "fabs %0"
+ [(set_attr "type" "fmove")
+ (set_attr "fp_mode" "double")])
+
(define_expand "extendsfdf2"
[(set (match_operand:DF 0 "fp_arith_reg_operand" "")
(float_extend:DF (match_operand:SF 1 "fpul_operand" "")))]