aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog61
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/cobol/ChangeLog133
-rw-r--r--gcc/config/i386/host-mingw32.cc32
-rw-r--r--gcc/config/i386/i386.cc88
-rw-r--r--gcc/config/i386/i386.h1
-rw-r--r--gcc/config/i386/i386.md18
-rw-r--r--gcc/config/i386/predicates.md1
-rw-r--r--gcc/config/mingw/mingw32.h9
-rw-r--r--gcc/config/mingw/winnt.cc14
-rw-r--r--gcc/config/mingw/winnt.h1
-rw-r--r--gcc/config/riscv/bitmanip.md59
-rw-r--r--gcc/config/riscv/riscv.md19
-rwxr-xr-xgcc/configure29
-rw-r--r--gcc/configure.ac29
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/gimple-fold.cc6
-rw-r--r--gcc/ipa-cp.cc10
-rw-r--r--gcc/m2/ChangeLog12
-rw-r--r--gcc/m2/gm2-compiler/M2GenGCC.mod3
-rw-r--r--gcc/m2/gm2-compiler/PCSymBuild.mod13
-rw-r--r--gcc/m2/gm2-compiler/SymbolTable.mod1
-rw-r--r--gcc/match.pd9
-rw-r--r--gcc/testsuite/ChangeLog62
-rw-r--r--gcc/testsuite/gcc.dg/pr120048.c12
-rw-r--r--gcc/testsuite/gcc.dg/pr120074.c20
-rw-r--r--gcc/testsuite/gcc.target/i386/pr111657-1.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/pr120031.c15
-rw-r--r--gcc/testsuite/gcc.target/riscv/pr119971.c24
-rw-r--r--gcc/testsuite/gcc.target/riscv/zbb-rol-ror-03.c2
-rw-r--r--gcc/testsuite/gm2/pim/pass/highbit.mod13
-rw-r--r--gcc/testsuite/gm2/pim/pass/highbit2.mod13
33 files changed, 639 insertions, 91 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 15fbb62..21446b6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,64 @@
+2025-05-05 Jeff Law <jlaw@ventanamicro.com>
+
+ PR target/119971
+ * config/riscv/bitmanip.md (rotation with masked count): Rewrite
+ as define_insn patterns. Fix formatting.
+ * config/riscv/riscv.md (shift with masked count): Similarly.
+
+2025-05-05 Uros Bizjak <ubizjak@gmail.com>
+ Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/120019
+ * config/i386/i386.cc (ix86_print_operand): Handle 'v' operand
+ modifier to emit segment override prefix.
+ * config/i386/i386.md (*strmovdi_rex_1): Use %v operand modifier
+ to emit segment override prefix.
+ (*strmovsi_1): Ditto.
+ (*strmovhi_1): Ditto.
+ (*strmovqi_1): Ditto.
+ (*rep_movdi_rex64): Ditto.
+ (*rep_movsi): Ditto.
+ (*rep_movqi): Ditto.
+
+2025-05-05 Andrew MacLeod <amacleod@redhat.com>
+
+ PR tree-optimization/120048
+ * ipa-cp.cc (ipcp_store_vr_results): Check for UNDEFINED.
+
+2025-05-05 Kyle Huey <khuey@kylehuey.com>
+
+ * dwarf2out.cc (resolve_addr_in_expr): Propagate dtprel into the address
+ table when appropriate.
+
+2025-05-05 Simon Martin <simon@nasilyan.com>
+
+ PR c++/118163
+ PR c++/118392
+ * diagnostic.cc (diagnostic_context::initialize): Initialize
+ m_diagnostic_groups.m_inhibiting_notes_from.
+ (diagnostic_context::inhibit_notes_in_group): New.
+ (diagnostic_context::notes_inhibited_in_group): New
+ (diagnostic_context::report_diagnostic): Call
+ inhibit_notes_in_group and notes_inhibited_in_group.
+ (diagnostic_context::end_group): Call inhibit_notes_in_group.
+ (diagnostic_context::pop_nesting_level): Ditto.
+ * diagnostic.h (diagnostic_context::m_diagnostic_groups): Add
+ member to track the depth at which a warning has been inhibited.
+ (diagnostic_context::notes_inhibited_in_group): Declare.
+ (diagnostic_context::inhibit_notes_in_group): Declare.
+ * doc/ux.texi: Document diagnostic_group behavior with regards
+ to inhibited warnings.
+
+2025-05-05 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/i386.md (truncsfbf2): Fix comment typo,
+ unsafte -> unsafe.
+
+2025-05-05 Kito Cheng <kito.cheng@sifive.com>
+
+ * config/riscv/genrvv-type-indexer.cc: Apply clang-format to the
+ file.
+
2025-05-04 Jeff Law <jlaw@ventanamicro.com>
* config.gcc (riscv): Add riscv-vect-permcost.o to extra_objs.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 568be1e..6906e73 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20250505
+20250506
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 9911402..128ea05 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2025-05-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/120104
+ * exp_ch3.adb (Expand_Freeze_Record_Type): For a controlled tagged
+ type, freeze only the controlled primitives that are present.
+
2025-04-30 Eric Botcazou <ebotcazou@adacore.com>
PR ada/112958
diff --git a/gcc/cobol/ChangeLog b/gcc/cobol/ChangeLog
index 7cd2ae0..c2bf3f3 100644
--- a/gcc/cobol/ChangeLog
+++ b/gcc/cobol/ChangeLog
@@ -1,3 +1,136 @@
+2025-05-05 Robert Dubner <rdubner@symas.com>
+
+ * cdf.y: Exceptions.
+ * except.cc (cbl_enabled_exception_t::dump): Likewise.
+ (cbl_enabled_exceptions_t::dump): Likewise.
+ (cbl_enabled_exceptions_t::status): Likewise.
+ (cbl_enabled_exceptions_t::encode): Likewise.
+ (cbl_enabled_exceptions_t::turn_on_off): Likewise.
+ (cbl_enabled_exceptions_t::match): Likewise.
+ (declarative_runtime_match): Likewise. Likewise.
+ * exceptg.h (struct cbl_exception_files_t): Likewise.
+ (class exception_turn_t): Likewise.
+ (apply_cdf_turn): Likewise.
+ * genapi.cc (treeplet_fill_source): Use refer_offset().
+ (function_handle_from_name): Likewise.
+ (parser_initialize_programs): Likewise.
+ (parser_statement_begin): Likewise.
+ (array_of_long_long): Exceptions.
+ (parser_compile_ecs): Exceptions.
+ (parser_compile_dcls): Exceptions.
+ (store_location_stuff): Exceptions.
+ (initialize_variable_internal): Use refer_offset().
+ (compare_binary_binary): Use refer_offset().
+ (cobol_compare): Use refer_offset().
+ (paragraph_label): Formatting.
+ (parser_goto): Use refer_offset().
+ (parser_perform_times): Likewise.
+ (internal_perform_through_times): Likewise.
+ (parser_enter_file): Exceptions.
+ (psa_FldLiteralN): Add comment.
+ (parser_accept): Use refer_offset().
+ (parser_accept_command_line): Likewise.
+ (parser_accept_command_line_count): Likewise.
+ (parser_accept_envar): Likewise.
+ (parser_set_envar): Likewise.
+ (parser_display_internal): Likewise.
+ (parser_initialize_table): Likewise.
+ (parser_sleep): Likewise.
+ (parser_allocate): Likewise.
+ (parser_free): Likewise.
+ (parser_division): Likewise.
+ (parser_relop_long): Likewise.
+ (parser_see_stop_run): Likewise.
+ (parser_classify): Likewise.
+ (parser_file_add): Include symbol_table_index in __gg__file_init().
+ (parser_file_open): Use refer_offset().
+ (parser_file_write): Move forward declaration of store_location_stuff().
+ (parser_file_start): Use refer_offset().
+ (parser_inspect_conv): Likewise:
+ (parser_intrinsic_numval_c): Likewise:
+ (parser_intrinsic_subst): Likewise:
+ (parser_intrinsic_call_1): Likewise:
+ (parser_intrinsic_call_2): Likewise:
+ (parser_intrinsic_call_3): Likewise:
+ (parser_intrinsic_call_4): Likewise:
+ (parser_sort): Likewise:
+ (parser_return_start): Exceptions.
+ (parser_unstring): Use refer_offset().
+ (create_and_call): Likewise.
+ (parser_set_pointers): Use refer_offset().
+ (parser_program_hierarchy): Comment.
+ (parser_set_handled): Exceptions; removed.
+ (parser_set_file_number): Exceptions; removed.
+ (stash_exceptions): Exceptions; removed.
+ (parser_exception_prepare): Exceptions; removed.
+ (parser_match_exception): Exceptions; eliminate blob.
+ (parser_check_fatal_exception): Exceptions.
+ (parser_push_exception): Create.
+ (parser_pop_exception): Create.
+ (mh_identical): Use refer_offset().
+ (mh_source_is_literalN): Likewise.
+ (mh_dest_is_float): Likewise.
+ (mh_numeric_display): Likewise.
+ (mh_little_endian): Likewise.
+ (mh_source_is_group): Likewise.
+ (move_helper): Likewise.
+ (binary_initial_from_float128): Formatting; change error message.
+ (initial_from_float128): Change name to "initial_from_initial"
+ (initial_from_initial): Add one byte to allocation for figconsts.
+ (parser_symbol_add): Use initial_from_initial().
+ (parser_symbol_add): Eliminate unneeded logic around actually_create...
+ * genapi.h: Exceptions.
+ * genmath.cc (fast_add): Use refer_offset().
+ (fast_subtract): Likewise.
+ (fast_multiply): Likewise.
+ (fast_divide): Likewise.
+ * genutil.cc: Exceptions; various global definitions.
+ (get_integer_value): Comment.
+ (get_data_offset_dest): Eliminate.
+ (get_data_offset_source): Rename to get_data_offset().
+ (get_data_offset): Use refer_offset().
+ (get_binary_value): Likewise; eliminate use of literal_decl_node.
+ (build_array_of_treeplets): Likewise.
+ (build_array_of_fourplets): Likewise.
+ (REFER_CHECK): Comment:
+ (refer_refmod_length): Use get_any_capacity(); use refer_offset;
+ set reflen to integer_one_node.
+ (refer_offset_dest): Change name to refer_offset.
+ (refer_offset): Use get_data_offset().
+ (refer_size_dest): Change name to refer_size().
+ (refer_size): Use get_any_capacity().
+ (refer_offset_source): Use refer_offset().
+ (refer_size_source): Likewise.
+ (qualified_data_source): Likewise.
+ (qualified_data_dest): Likewise.
+ (qualified_data_location): Likewise.
+ * genutil.h: Exceptions; changes to global declarations.
+ * lexio.cc (likely_nist_file): Added to detect NIST file format.
+ (cdftext::free_form_reference_format): Handle NIST file format.
+ * parse.y: (strip_trailing_zeroes): Added.
+ Changes for exceptions.
+ * parse_ante.h (parse_error_inc): Likewise.
+ (YYLLOC_DEFAULT): Likewise.
+ (static_cast): Likewise.
+ (is_cobol_word): Change to is_cobol_charset.
+ (is_cobol_charset): Refine allowed characters.
+ (require_numeric): Change to require integer.
+ (require_integer): Likewise.
+ (current_enabled_ecs): Exceptions.
+ (is_integer_literal): Change interpretation.
+ (procedure_division_ready): Exceptions.
+ (statement_epilog): Likewise.
+ (statement_begin): Likewise.
+ * show_parse.h: Changes to GCOBOL_SHOW handling.
+ * structs.cc: Add symbol_index to cblc_file_t structure.
+ * symbols.cc (field_str): Repair .initial handling in FldLiteralN.
+ * symbols.h (struct cbl_field_t): Eliminate literal_decl_node.
+ (current_enabled_ecs): Exceptions.
+ * util.cc (cbl_message): Add final newline to error message.
+ (ftoupper): Added.
+ (iso_cobol_word): Add list of ISO reserved words.
+ * util.h (ftoupper): Added.
+
2025-05-02 Jakub Jelinek <jakub@redhat.com>
PR cobol/119364
diff --git a/gcc/config/i386/host-mingw32.cc b/gcc/config/i386/host-mingw32.cc
index e083f49..87804a5 100644
--- a/gcc/config/i386/host-mingw32.cc
+++ b/gcc/config/i386/host-mingw32.cc
@@ -135,7 +135,6 @@ mingw32_gt_pch_use_address (void *&addr, size_t size, int fd,
and earlier, backslashes are invalid in object name. So, we need
to check if we are on Windows2000 or higher. */
OSVERSIONINFO version_info;
- int r;
version_info.dwOSVersionInfoSize = sizeof (version_info);
@@ -169,25 +168,24 @@ mingw32_gt_pch_use_address (void *&addr, size_t size, int fd,
return -1;
}
- /* Retry five times, as here might occure a race with multiple gcc's
- instances at same time. */
- for (r = 0; r < 5; r++)
- {
- mmap_addr = MapViewOfFileEx (mmap_handle, FILE_MAP_COPY, 0, offset,
- size, addr);
- if (mmap_addr == addr)
- break;
- if (r != 4)
- Sleep (500);
- }
-
- if (mmap_addr != addr)
+ /* Try mapping the file at `addr`. */
+ mmap_addr = MapViewOfFileEx (mmap_handle, FILE_MAP_COPY, 0, offset,
+ size, addr);
+ if (mmap_addr == NULL)
{
- w32_error (__FUNCTION__, __FILE__, __LINE__, "MapViewOfFileEx");
- CloseHandle(mmap_handle);
- return -1;
+ /* We could not map the file at its original address, so let the
+ system choose a different one. The PCH can be relocated later. */
+ mmap_addr = MapViewOfFileEx (mmap_handle, FILE_MAP_COPY, 0, offset,
+ size, NULL);
+ if (mmap_addr == NULL)
+ {
+ w32_error (__FUNCTION__, __FILE__, __LINE__, "MapViewOfFileEx");
+ CloseHandle(mmap_handle);
+ return -1;
+ }
}
+ addr = mmap_addr;
return 1;
}
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 5ad47e1..89f518c 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -11363,6 +11363,9 @@ ix86_legitimate_constant_p (machine_mode mode, rtx x)
x = XVECEXP (x, 0, 0);
return (GET_CODE (x) == SYMBOL_REF
&& SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_DYNAMIC);
+ case UNSPEC_SECREL32:
+ x = XVECEXP (x, 0, 0);
+ return GET_CODE (x) == SYMBOL_REF;
default:
return false;
}
@@ -11499,6 +11502,9 @@ legitimate_pic_operand_p (rtx x)
x = XVECEXP (inner, 0, 0);
return (GET_CODE (x) == SYMBOL_REF
&& SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_EXEC);
+ case UNSPEC_SECREL32:
+ x = XVECEXP (inner, 0, 0);
+ return GET_CODE (x) == SYMBOL_REF;
case UNSPEC_MACHOPIC_OFFSET:
return legitimate_pic_address_disp_p (x);
default:
@@ -11679,6 +11685,9 @@ legitimate_pic_address_disp_p (rtx disp)
disp = XVECEXP (disp, 0, 0);
return (GET_CODE (disp) == SYMBOL_REF
&& SYMBOL_REF_TLS_MODEL (disp) == TLS_MODEL_LOCAL_DYNAMIC);
+ case UNSPEC_SECREL32:
+ disp = XVECEXP (disp, 0, 0);
+ return GET_CODE (disp) == SYMBOL_REF;
}
return false;
@@ -11956,6 +11965,7 @@ ix86_legitimate_address_p (machine_mode, rtx addr, bool strict,
case UNSPEC_INDNTPOFF:
case UNSPEC_NTPOFF:
case UNSPEC_DTPOFF:
+ case UNSPEC_SECREL32:
break;
default:
@@ -11981,7 +11991,8 @@ ix86_legitimate_address_p (machine_mode, rtx addr, bool strict,
|| GET_CODE (XEXP (XEXP (disp, 0), 0)) != UNSPEC
|| !CONST_INT_P (XEXP (XEXP (disp, 0), 1))
|| (XINT (XEXP (XEXP (disp, 0), 0), 1) != UNSPEC_DTPOFF
- && XINT (XEXP (XEXP (disp, 0), 0), 1) != UNSPEC_NTPOFF))
+ && XINT (XEXP (XEXP (disp, 0), 0), 1) != UNSPEC_NTPOFF
+ && XINT (XEXP (XEXP (disp, 0), 0), 1) != UNSPEC_SECREL32))
/* Non-constant pic memory reference. */
return false;
}
@@ -12305,6 +12316,24 @@ get_thread_pointer (machine_mode tp_mode, bool to_reg)
return tp;
}
+/* Construct the SYMBOL_REF for the _tls_index symbol. */
+
+static GTY(()) rtx ix86_tls_index_symbol;
+
+#if TARGET_WIN32_TLS
+static rtx
+ix86_tls_index (void)
+{
+ if (!ix86_tls_index_symbol)
+ ix86_tls_index_symbol = gen_rtx_SYMBOL_REF (SImode, "_tls_index");
+
+ if (flag_pic)
+ return gen_rtx_CONST (Pmode, gen_rtx_UNSPEC (Pmode, gen_rtvec (1, ix86_tls_index_symbol), UNSPEC_PCREL));
+ else
+ return ix86_tls_index_symbol;
+}
+#endif
+
/* Construct the SYMBOL_REF for the tls_get_addr function. */
static GTY(()) rtx ix86_tls_symbol;
@@ -12363,6 +12392,26 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
machine_mode tp_mode = Pmode;
int type;
+#if TARGET_WIN32_TLS
+ off = gen_const_mem (SImode, ix86_tls_index ());
+ set_mem_alias_set (off, GOT_ALIAS_SET);
+
+ tp = gen_const_mem (Pmode, GEN_INT (TARGET_64BIT ? 88 : 44));
+ set_mem_addr_space (tp, DEFAULT_TLS_SEG_REG);
+
+ if (TARGET_64BIT)
+ off = convert_to_mode (Pmode, off, 1);
+
+ base = force_reg (Pmode, off);
+ tp = copy_to_mode_reg (Pmode, tp);
+
+ tp = gen_const_mem (Pmode, gen_rtx_PLUS (Pmode, tp, gen_rtx_MULT (Pmode, base, GEN_INT (UNITS_PER_WORD))));
+ set_mem_alias_set (tp, GOT_ALIAS_SET);
+
+ base = force_reg (Pmode, tp);
+
+ return gen_rtx_PLUS (Pmode, base, gen_rtx_CONST (Pmode, gen_rtx_UNSPEC (SImode, gen_rtvec (1, x), UNSPEC_SECREL32)));
+#else
/* Fall back to global dynamic model if tool chain cannot support local
dynamic. */
if (TARGET_SUN_TLS && !TARGET_64BIT
@@ -12585,6 +12634,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
}
return dest;
+#endif
}
/* Return true if the TLS address requires insn using integer registers.
@@ -13054,6 +13104,9 @@ output_pic_addr_const (FILE *file, rtx x, int code)
case UNSPEC_INDNTPOFF:
fputs ("@indntpoff", file);
break;
+ case UNSPEC_SECREL32:
+ fputs ("@secrel32", file);
+ break;
#if TARGET_MACHO
case UNSPEC_MACHOPIC_OFFSET:
putc ('-', file);
@@ -13079,7 +13132,11 @@ i386_output_dwarf_dtprel (FILE *file, int size, rtx x)
{
fputs (ASM_LONG, file);
output_addr_const (file, x);
+#if TARGET_WIN32_TLS
+ fputs ("@secrel32", file);
+#else
fputs ("@dtpoff", file);
+#endif
switch (size)
{
case 4:
@@ -13738,10 +13795,11 @@ print_reg (rtx x, int code, FILE *file)
H -- print a memory address offset by 8; used for sse high-parts
Y -- print condition for XOP pcom* instruction.
V -- print naked full integer register name without %.
+ v -- print segment override prefix
+ -- print a branch hint as 'cs' or 'ds' prefix
; -- print a semicolon (after prefixes due to bug in older gas).
~ -- print "i" if TARGET_AVX2, "f" otherwise.
- ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode
+ ^ -- print addr32 prefix if Pmode != word_mode
M -- print addr32 prefix for TARGET_X32 with VSIB address.
! -- print NOTRACK prefix for jxx/call/ret instructions if required.
N -- print maskz if it's constant 0 operand.
@@ -14243,6 +14301,28 @@ ix86_print_operand (FILE *file, rtx x, int code)
return;
+ case 'v':
+ if (MEM_P (x))
+ {
+ switch (MEM_ADDR_SPACE (x))
+ {
+ case ADDR_SPACE_GENERIC:
+ break;
+ case ADDR_SPACE_SEG_FS:
+ fputs ("fs ", file);
+ break;
+ case ADDR_SPACE_SEG_GS:
+ fputs ("gs ", file);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ }
+ else
+ output_operand_lossage ("operand is not a memory reference, "
+ "invalid operand code 'v'");
+ return;
+
case '*':
if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('*', file);
@@ -14832,6 +14912,10 @@ i386_asm_output_addr_const_extra (FILE *file, rtx x)
output_addr_const (file, op);
fputs ("@indntpoff", file);
break;
+ case UNSPEC_SECREL32:
+ output_addr_const (file, op);
+ fputs ("@secrel32", file);
+ break;
#if TARGET_MACHO
case UNSPEC_MACHOPIC_OFFSET:
output_addr_const (file, op);
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 18aa42d..02bf357 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -531,6 +531,7 @@ extern unsigned char ix86_prefetch_sse;
#define TARGET_GNU2_TLS (ix86_tls_dialect == TLS_DIALECT_GNU2)
#define TARGET_ANY_GNU_TLS (TARGET_GNU_TLS || TARGET_GNU2_TLS)
#define TARGET_SUN_TLS 0
+#define TARGET_WIN32_TLS 0
#ifndef TARGET_64BIT_DEFAULT
#define TARGET_64BIT_DEFAULT 0
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index bb02ab0..d671480 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -58,10 +58,11 @@
;; H -- print a memory address offset by 8; used for sse high-parts
;; K -- print HLE lock prefix
;; Y -- print condition for XOP pcom* instruction.
+;; v -- print segment override prefix
;; + -- print a branch hint as 'cs' or 'ds' prefix
;; ; -- print a semicolon (after prefixes due to bug in older gas).
;; ~ -- print "i" if TARGET_AVX2, "f" otherwise.
-;; ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode
+;; ^ -- print addr32 prefix if Pmode != word_mode
;; ! -- print NOTRACK prefix for jxx/call/ret instructions if required.
(define_c_enum "unspec" [
@@ -79,6 +80,7 @@
UNSPEC_MACHOPIC_OFFSET
UNSPEC_PCREL
UNSPEC_SIZEOF
+ UNSPEC_SECREL32
;; Prologue support
UNSPEC_STACK_ALLOC
@@ -25643,7 +25645,7 @@
operands[0] = SET_DEST (exp);
operands[1] = SET_SRC (exp);
- return "movsq\t{%1, %0|%0, %1}";
+ return "%^%v1movsq";
}
[(set_attr "type" "str")
(set_attr "memory" "both")
@@ -25666,7 +25668,7 @@
operands[0] = SET_DEST (exp);
operands[1] = SET_SRC (exp);
- return "movs{l|d}\t{%1, %0|%0, %1}";
+ return "%^%v1movs{l|d}";
}
[(set_attr "type" "str")
(set_attr "memory" "both")
@@ -25689,7 +25691,7 @@
operands[0] = SET_DEST (exp);
operands[1] = SET_SRC (exp);
- return "movsw\t{%1, %0|%0, %1}";
+ return "%^%v1movsw";
}
[(set_attr "type" "str")
(set_attr "memory" "both")
@@ -25712,7 +25714,7 @@
operands[0] = SET_DEST (exp);
operands[1] = SET_SRC (exp);
- return "movsb\t{%1, %0|%0, %1}";
+ return "%^%v1movsb";
}
[(set_attr "type" "str")
(set_attr "memory" "both")
@@ -25759,7 +25761,7 @@
operands[0] = SET_DEST (exp);
operands[1] = SET_SRC (exp);
- return "rep{%;} movsq\t{%1, %0|%0, %1}";
+ return "%^%v1rep{%;} movsq";
}
[(set_attr "type" "str")
(set_attr "prefix_rep" "1")
@@ -25786,7 +25788,7 @@
operands[0] = SET_DEST (exp);
operands[1] = SET_SRC (exp);
- return "rep{%;} movs{l|d}\t{%1, %0|%0, %1}";
+ return "%^%v1rep{%;} movs{l|d}";
}
[(set_attr "type" "str")
(set_attr "prefix_rep" "1")
@@ -25811,7 +25813,7 @@
operands[0] = SET_DEST (exp);
operands[1] = SET_SRC (exp);
- return "rep{%;} movsb\t{%1, %0|%0, %1}";
+ return "%^%v1rep{%;} movsb";
}
[(set_attr "type" "str")
(set_attr "prefix_rep" "1")
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 4b23e18..fbf2dd9 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -218,6 +218,7 @@
case UNSPEC_DTPOFF:
case UNSPEC_GOTNTPOFF:
case UNSPEC_NTPOFF:
+ case UNSPEC_SECREL32:
return true;
default:
break;
diff --git a/gcc/config/mingw/mingw32.h b/gcc/config/mingw/mingw32.h
index 10bcd29..be2461f 100644
--- a/gcc/config/mingw/mingw32.h
+++ b/gcc/config/mingw/mingw32.h
@@ -308,6 +308,15 @@ do { \
#undef TARGET_N_FORMAT_TYPES
#define TARGET_N_FORMAT_TYPES 3
+#undef TARGET_WIN32_TLS
+#define TARGET_WIN32_TLS 1
+
+#undef TARGET_ASM_SELECT_SECTION
+#define TARGET_ASM_SELECT_SECTION mingw_pe_select_section
+
+#undef DEFAULT_TLS_SEG_REG
+#define DEFAULT_TLS_SEG_REG (TARGET_64BIT ? ADDR_SPACE_SEG_GS : ADDR_SPACE_SEG_FS)
+
#define HAVE_ENABLE_EXECUTE_STACK
#undef CHECK_EXECUTE_STACK_ENABLED
#define CHECK_EXECUTE_STACK_ENABLED flag_setstackexecutable
diff --git a/gcc/config/mingw/winnt.cc b/gcc/config/mingw/winnt.cc
index 08a761d..f224966 100644
--- a/gcc/config/mingw/winnt.cc
+++ b/gcc/config/mingw/winnt.cc
@@ -391,6 +391,15 @@ i386_pe_strip_name_encoding_full (const char *str)
return name;
}
+section *
+mingw_pe_select_section (tree decl, int reloc, unsigned HOST_WIDE_INT align)
+{
+ if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL_P (decl))
+ return get_named_section (decl, ".tls$", reloc);
+ else
+ return default_select_section (decl, reloc, align);
+}
+
void
mingw_pe_unique_section (tree decl, int reloc)
{
@@ -415,6 +424,8 @@ mingw_pe_unique_section (tree decl, int reloc)
prefix = ".text$";
else if (decl_readonly_section (decl, reloc))
prefix = ".rdata$";
+ else if (DECL_THREAD_LOCAL_P (decl))
+ prefix = ".tls$";
else
prefix = ".data$";
len = strlen (name) + strlen (prefix);
@@ -489,6 +500,9 @@ mingw_pe_asm_named_section (const char *name, unsigned int flags,
*f++ = 'e';
#endif
+ if (strcmp (name, ".tls$") == 0)
+ *f++ = 'd';
+
if ((flags & (SECTION_CODE | SECTION_WRITE)) == 0)
/* readonly data */
{
diff --git a/gcc/config/mingw/winnt.h b/gcc/config/mingw/winnt.h
index fa2d6c0..23f4dc9 100644
--- a/gcc/config/mingw/winnt.h
+++ b/gcc/config/mingw/winnt.h
@@ -31,6 +31,7 @@ extern void mingw_pe_file_end (void);
extern void mingw_pe_maybe_record_exported_symbol (tree, const char *, int);
extern void mingw_pe_record_stub (const char *, bool);
extern unsigned int mingw_pe_section_type_flags (tree, const char *, int);
+extern section *mingw_pe_select_section (tree, int, unsigned HOST_WIDE_INT);
extern void mingw_pe_unique_section (tree, int);
extern bool mingw_pe_valid_dllimport_attribute_p (const_tree);
diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md
index d0919ec..20d03dc 100644
--- a/gcc/config/riscv/bitmanip.md
+++ b/gcc/config/riscv/bitmanip.md
@@ -423,39 +423,40 @@
"rolw\t%0,%1,%2"
[(set_attr "type" "bitmanip")])
-(define_insn_and_split "*<bitmanip_optab><GPR:mode>3_mask"
- [(set (match_operand:GPR 0 "register_operand" "= r")
- (bitmanip_rotate:GPR
- (match_operand:GPR 1 "register_operand" " r")
- (match_operator 4 "subreg_lowpart_operator"
- [(and:GPR2
- (match_operand:GPR2 2 "register_operand" "r")
- (match_operand 3 "<GPR:shiftm1>" "<GPR:shiftm1p>"))])))]
+(define_insn "*<bitmanip_optab><mode>3_mask"
+ [(set (match_operand:X 0 "register_operand" "=r")
+ (bitmanip_rotate:X
+ (match_operand:X 1 "register_operand" "r")
+ (match_operator 4 "subreg_lowpart_operator"
+ [(and:X (match_operand:X 2 "register_operand" "r")
+ (match_operand 3 "<X:shiftm1>" "<X:shiftm1p>"))])))]
"TARGET_ZBB || TARGET_ZBKB"
- "#"
- "&& 1"
- [(set (match_dup 0)
- (bitmanip_rotate:GPR (match_dup 1)
- (match_dup 2)))]
- "operands[2] = gen_lowpart (QImode, operands[2]);"
+ "<bitmanip_insn>\t%0,%1,%2"
[(set_attr "type" "bitmanip")
- (set_attr "mode" "<GPR:MODE>")])
+ (set_attr "mode" "<X:MODE>")])
-(define_insn_and_split "*<bitmanip_optab>si3_sext_mask"
- [(set (match_operand:DI 0 "register_operand" "= r")
- (sign_extend:DI (bitmanip_rotate:SI
- (match_operand:SI 1 "register_operand" " r")
- (match_operator 4 "subreg_lowpart_operator"
- [(and:GPR
- (match_operand:GPR 2 "register_operand" "r")
- (match_operand 3 "const_si_mask_operand"))]))))]
+(define_insn "*<bitmanip_optab>3_mask_si"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (bitmanip_rotate:SI
+ (match_operand:SI 1 "register_operand" "r")
+ (match_operator 3 "subreg_lowpart_operator"
+ [(and:X (match_operand:SI 2 "register_operand" "r")
+ (const_int 31))])))]
"TARGET_64BIT && (TARGET_ZBB || TARGET_ZBKB)"
- "#"
- "&& 1"
- [(set (match_dup 0)
- (sign_extend:DI (bitmanip_rotate:SI (match_dup 1)
- (match_dup 2))))]
- "operands[2] = gen_lowpart (QImode, operands[2]);"
+ "<bitmanip_insn>w\t%0,%1,%2"
+ [(set_attr "type" "bitmanip")
+ (set_attr "mode" "SI")])
+
+(define_insn "*<bitmanip_optab>si3_sext_mask"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (sign_extend:DI
+ (bitmanip_rotate:SI
+ (match_operand:SI 1 "register_operand" "r")
+ (match_operator 3 "subreg_lowpart_operator"
+ [(and:X (match_operand:GPR 2 "register_operand" "r")
+ (const_int 31))]))))]
+ "TARGET_64BIT && (TARGET_ZBB || TARGET_ZBKB)"
+ "<bitmanip_insn>w\t%0,%1,%2"
[(set_attr "type" "bitmanip")
(set_attr "mode" "DI")])
diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md
index c34eadb..15c89ff 100644
--- a/gcc/config/riscv/riscv.md
+++ b/gcc/config/riscv/riscv.md
@@ -2937,7 +2937,7 @@
[(set_attr "type" "shift")
(set_attr "mode" "DI")])
-(define_insn_and_split "*<optab><GPR:mode>3_mask_1"
+(define_insn "*<optab><GPR:mode>3_mask_1"
[(set (match_operand:GPR 0 "register_operand" "= r")
(any_shift:GPR
(match_operand:GPR 1 "register_operand" " r")
@@ -2946,12 +2946,7 @@
(match_operand:GPR2 2 "register_operand" "r")
(match_operand 3 "<GPR:shiftm1>"))])))]
""
- "#"
- "&& 1"
- [(set (match_dup 0)
- (any_shift:GPR (match_dup 1)
- (match_dup 2)))]
- "operands[2] = gen_lowpart (QImode, operands[2]);"
+ "<insn>\t%0,%1,%2"
[(set_attr "type" "shift")
(set_attr "mode" "<GPR:MODE>")])
@@ -2970,7 +2965,7 @@
[(set_attr "type" "shift")
(set_attr "mode" "SI")])
-(define_insn_and_split "*<optab>si3_extend_mask"
+(define_insn "*<optab>si3_extend_mask"
[(set (match_operand:DI 0 "register_operand" "= r")
(sign_extend:DI
(any_shift:SI
@@ -2980,13 +2975,7 @@
(match_operand:GPR 2 "register_operand" " r")
(match_operand 3 "const_si_mask_operand"))]))))]
"TARGET_64BIT"
- "#"
- "&& 1"
- [(set (match_dup 0)
- (sign_extend:DI
- (any_shift:SI (match_dup 1)
- (match_dup 2))))]
- "operands[2] = gen_lowpart (QImode, operands[2]);"
+ "<insn>w\t%0,%1,%2"
[(set_attr "type" "shift")
(set_attr "mode" "SI")])
diff --git a/gcc/configure b/gcc/configure
index 1696595..776b062 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -27864,6 +27864,35 @@ if test $gcc_cv_as_tls = yes; then
fi
fi
+case $target_os in
+ win32 | pe | cygwin* | mingw32*)
+ if test $set_have_as_tls = yes; then
+ # Hack to check whether ld breaks on @secrel32 for Windows
+ if test $in_tree_ld = yes; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 44 -o "$gcc_cv_gld_major_version" -gt 2; then
+ : # ld support for @secrel32 was fixed in this version
+ else
+ as_fn_error $? "ld version is known to have broken secrel32 relocations, configure without --enable-tls or with --disable-tls to remove this error. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881 for more information." "$LINENO" 5
+ fi
+ elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x; then
+ echo '.text' > conftest.s
+ echo 'foo: nop' >> conftest.s
+ echo '.data' >> conftest.s
+ echo '.secrel32 foo' >> conftest.s
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 && $gcc_cv_ld -o conftest.exe conftest.o > /dev/null; then
+ if $gcc_cv_objdump -h conftest.exe | grep '\.reloc\>' > /dev/null; then
+ as_fn_error $? "ld has broken secrel32 relocations, configure without --enable-tls or with --disable-tls to remove this error. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881 for more information." "$LINENO" 5
+ fi
+ else
+ as_fn_error $? "Error occurred while checking for broken secrel32 relocations. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881 for more information." "$LINENO" 5
+ fi
+ rm -f conftest.s conftest.o conftest.exe
+ else
+ as_fn_error $? "Cannot check for broken secrel32 relocations to determine --enable-tls support. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881 for more information." "$LINENO" 5
+ fi
+ fi
+ ;;
+esac
if test $set_have_as_tls = yes ; then
$as_echo "#define HAVE_AS_TLS 1" >>confdefs.h
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 9f67e62..b6db9ed 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4207,6 +4207,35 @@ else
[$tls_as_opt], [$conftest_s],,
[set_have_as_tls=yes])
fi
+case $target_os in
+ win32 | pe | cygwin* | mingw32*)
+ if test $set_have_as_tls = yes; then
+ # Hack to check whether ld breaks on @secrel32 for Windows
+ if test $in_tree_ld = yes; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 44 -o "$gcc_cv_gld_major_version" -gt 2; then
+ : # ld support for @secrel32 was fixed in this version
+ else
+ AC_MSG_ERROR([ld version is known to have broken secrel32 relocations, configure without --enable-tls or with --disable-tls to remove this error. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881 for more information.])
+ fi
+ elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x; then
+ echo '.text' > conftest.s
+ echo 'foo: nop' >> conftest.s
+ echo '.data' >> conftest.s
+ echo '.secrel32 foo' >> conftest.s
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 && $gcc_cv_ld -o conftest.exe conftest.o > /dev/null; then
+ if $gcc_cv_objdump -h conftest.exe | grep '\.reloc\>' > /dev/null; then
+ AC_MSG_ERROR([ld has broken secrel32 relocations, configure without --enable-tls or with --disable-tls to remove this error. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881 for more information.])
+ fi
+ else
+ AC_MSG_ERROR([Error occurred while checking for broken secrel32 relocations. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881 for more information.])
+ fi
+ rm -f conftest.s conftest.o conftest.exe
+ else
+ AC_MSG_ERROR([Cannot check for broken secrel32 relocations to determine --enable-tls support. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881 for more information.])
+ fi
+ fi
+ ;;
+esac
if test $set_have_as_tls = yes ; then
AC_DEFINE(HAVE_AS_TLS, 1,
[Define if your assembler and linker support thread-local storage.])
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a99a1cc..bcce377 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2025-05-05 Simon Martin <simon@nasilyan.com>
+
+ * cp-tree.h (parsing_default_capturing_generic_lambda_in_template):
+ Remove obsolete prototype.
+
2025-05-02 Jason Merrill <jason@redhat.com>
PR c++/115207
diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc
index 94d5a1e..5884b79 100644
--- a/gcc/gimple-fold.cc
+++ b/gcc/gimple-fold.cc
@@ -8334,6 +8334,8 @@ fold_truth_andor_for_ifcombine (enum tree_code code, tree truth_type,
ll_and_mask &= sign;
if (l_xor)
{
+ if (ll_bitsize != lr_bitsize)
+ return 0;
if (!lr_and_mask.get_precision ())
lr_and_mask = sign;
else
@@ -8355,6 +8357,8 @@ fold_truth_andor_for_ifcombine (enum tree_code code, tree truth_type,
rl_and_mask &= sign;
if (r_xor)
{
+ if (rl_bitsize != rr_bitsize)
+ return 0;
if (!rr_and_mask.get_precision ())
rr_and_mask = sign;
else
@@ -8762,7 +8766,7 @@ fold_truth_andor_for_ifcombine (enum tree_code code, tree truth_type,
wide_int lr_mask, rr_mask;
if (lr_and_mask.get_precision ())
lr_mask = wi::lshift (wide_int::from (lr_and_mask, rnprec, UNSIGNED),
- xlr_bitpos);
+ xlr_bitpos);
else
lr_mask = wi::shifted_mask (xlr_bitpos, lr_bitsize, false, rnprec);
if (rr_and_mask.get_precision ())
diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
index f7e5aa9..b41148c 100644
--- a/gcc/ipa-cp.cc
+++ b/gcc/ipa-cp.cc
@@ -6362,6 +6362,11 @@ ipcp_store_vr_results (void)
TYPE_PRECISION (type),
TYPE_SIGN (type)));
tmp.update_bitmask (bm);
+ // Reflecting the bitmask on the ranges can sometime
+ // produce an UNDEFINED value if the the bitmask update
+ // was previously deferred. See PR 120048.
+ if (tmp.undefined_p ())
+ tmp.set_varying (type);
ipa_vr vr (tmp);
ts->m_vr->quick_push (vr);
}
@@ -6383,6 +6388,11 @@ ipcp_store_vr_results (void)
TYPE_PRECISION (type),
TYPE_SIGN (type)));
tmp.update_bitmask (bm);
+ // Reflecting the bitmask on the ranges can sometime
+ // produce an UNDEFINED value if the the bitmask update
+ // was previously deferred. See PR 120048.
+ if (tmp.undefined_p ())
+ tmp.set_varying (type);
ipa_vr vr (tmp);
ts->m_vr->quick_push (vr);
}
diff --git a/gcc/m2/ChangeLog b/gcc/m2/ChangeLog
index 5290f7c..058468b 100644
--- a/gcc/m2/ChangeLog
+++ b/gcc/m2/ChangeLog
@@ -1,3 +1,15 @@
+2025-05-05 Gaius Mulley <gaiusmod2@gmail.com>
+
+ PR modula2/120117
+ * gm2-compiler/M2GenGCC.mod (FoldBecomes): Remove the call to
+ RemoveQuad since this is performed by TypeCheckBecomes.
+ * gm2-compiler/PCSymBuild.mod (buildConstFunction): Rewrite
+ header comment.
+ Check for a set or a type aliased set and appropriately
+ skip type equivalences and obtain the element type.
+ * gm2-compiler/SymbolTable.mod (PutConst): Add call to
+ CheckBreak.
+
2025-04-24 Gaius Mulley <gaiusmod2@gmail.com>
PR modula2/119915
diff --git a/gcc/m2/gm2-compiler/M2GenGCC.mod b/gcc/m2/gm2-compiler/M2GenGCC.mod
index a1e3c07..bc1d588 100644
--- a/gcc/m2/gm2-compiler/M2GenGCC.mod
+++ b/gcc/m2/gm2-compiler/M2GenGCC.mod
@@ -2914,9 +2914,6 @@ BEGIN
IF TypeCheckBecomes (p, quad)
THEN
PerformFoldBecomes (p, quad)
- ELSE
- GetQuad (quad, op, des, op2, expr) ;
- RemoveQuad (p, des, quad)
END
END
END
diff --git a/gcc/m2/gm2-compiler/PCSymBuild.mod b/gcc/m2/gm2-compiler/PCSymBuild.mod
index b124c3e..3bffe86 100644
--- a/gcc/m2/gm2-compiler/PCSymBuild.mod
+++ b/gcc/m2/gm2-compiler/PCSymBuild.mod
@@ -64,7 +64,7 @@ FROM SymbolTable IMPORT NulSym, ModeOfAddr, ProcedureKind,
GetFromOuterModule,
CheckForEnumerationInCurrentModule,
GetMode, PutVariableAtAddress, ModeOfAddr, SkipType,
- IsSet, PutConstSet,
+ IsSet, PutConstSet, IsType,
IsConst, IsConstructor, PutConst, PutConstructor,
PopValue, PushValue,
MakeTemporary, PutVar,
@@ -1408,9 +1408,10 @@ END TypeToMeta ;
(*
- buildConstFunction - we are only concerned about resolving the return type o
+ buildConstFunction - we are only concerned about resolving the return type of
a function, so we can ignore all parameters - except
- the first one in the case of VAL(type, foo).
+ the first one in the case of VAL(type, foo)
+ and the type of bar in MIN (bar) and MAX (bar).
buildConstFunction uses a unary exprNode to represent
a function.
*)
@@ -1866,11 +1867,11 @@ BEGIN
THEN
IF (func=Min) OR (func=Max)
THEN
- IF IsSet (sym)
+ IF IsSet (sym) OR (IsType (sym) AND IsSet (SkipType (sym)))
THEN
- type := SkipType(GetType(sym))
+ type := GetType (SkipType (sym))
ELSE
- (* sym is the type required for MAX, MIN and VAL *)
+ (* sym is the type required for MAX, MIN and VAL. *)
type := sym
END
ELSE
diff --git a/gcc/m2/gm2-compiler/SymbolTable.mod b/gcc/m2/gm2-compiler/SymbolTable.mod
index 551bbec..ff661dc 100644
--- a/gcc/m2/gm2-compiler/SymbolTable.mod
+++ b/gcc/m2/gm2-compiler/SymbolTable.mod
@@ -7265,6 +7265,7 @@ VAR
pSym: PtrToSymbol ;
BEGIN
pSym := GetPsym(Sym) ;
+ CheckBreak (Sym) ;
WITH pSym^ DO
CASE SymbolType OF
diff --git a/gcc/match.pd b/gcc/match.pd
index a150de5..ab496d9 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -1123,9 +1123,9 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
#endif
/* (nop_outer_cast)-(inner_cast)var -> -(outer_cast)(var)
- if var is smaller in precision.
- This is always safe for both doing the negative in signed or unsigned
- as the value for undefined will not show up.
+ If var is smaller in precision this is always safe for both doing
+ the negative in signed or unsigned as the value for undefined will not
+ show up. Else it is safe if the negation is done in an unsigned type.
Note the outer cast cannot be a boolean type as the only valid values
are 0,-1/1 (depending on the signedness of the boolean) and the negative
is there to get the correct value. */
@@ -1133,7 +1133,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(convert (negate:s@1 (convert:s @0)))
(if (INTEGRAL_TYPE_P (type)
&& tree_nop_conversion_p (type, TREE_TYPE (@1))
- && TYPE_PRECISION (type) > TYPE_PRECISION (TREE_TYPE (@0))
+ && (TYPE_PRECISION (type) > TYPE_PRECISION (TREE_TYPE (@0))
+ || TYPE_UNSIGNED (type))
&& TREE_CODE (type) != BOOLEAN_TYPE)
(negate (convert @0))))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8b7e652..4551e2d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,65 @@
+2025-05-05 Jeff Law <jlaw@ventanamicro.com>
+
+ PR target/119971
+ * gcc.target/riscv/pr119971.c: New test.
+ * gcc.target/riscv/zbb-rol-ror-03.c: Adjust test slightly.
+
+2025-05-05 Uros Bizjak <ubizjak@gmail.com>
+ Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/120019
+ * gcc.target/i386/pr111657-1.c (dg-do): Change to "assemble".
+ (dg-options): Remove -masm=att and add -save-temps.
+ (dg-final): Update scan-assembler and scan-assembler-not strings.
+
+2025-05-05 Gaius Mulley <gaiusmod2@gmail.com>
+
+ PR modula2/120117
+ * gm2/pim/pass/highbit.mod: New test.
+ * gm2/pim/pass/highbit2.mod: New test.
+
+2025-05-05 Andrew MacLeod <amacleod@redhat.com>
+
+ PR tree-optimization/120048
+ * gcc.dg/pr120048.c: New.
+
+2025-05-05 Kito Cheng <kito.cheng@sifive.com>
+
+ PR target/120054
+ * gcc.target/riscv/predef-19.c: Adjust testcase.
+
+2025-05-05 John David Anglin <danglin@gcc.gnu.org>
+
+ PR testsuite/120085
+ * gcc.dg/lto/modref-2_0.c: Link test with libm.
+
+2025-05-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/specs/finalizable1.ads: New test.
+
+2025-05-05 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR middle-end/112877
+ * gcc.dg/vect/vect-simd-clone-16c.c: Fix target selector syntax.
+ * gcc.dg/vect/vect-simd-clone-16d.c: Likewise.
+ * gcc.dg/vect/vect-simd-clone-17c.c: Likewise.
+ * gcc.dg/vect/vect-simd-clone-17d.c: Likewise.
+ * gcc.dg/vect/vect-simd-clone-18c.c: Likewise.
+ * gcc.dg/vect/vect-simd-clone-18d.c: Likewise.
+
+2025-05-05 Simon Martin <simon@nasilyan.com>
+
+ PR c++/118163
+ PR c++/118392
+ * g++.dg/diagnostic/incomplete-type-2.C: New test.
+ * g++.dg/diagnostic/incomplete-type-2a.C: New test.
+ * g++.dg/diagnostic/inhibit-warn-3.C: New test.
+
+2025-05-05 Richard Biener <rguenther@suse.de>
+
+ PR testsuite/120084
+ * gcc.dg/lto/pr60779_0.c: Require linker-plugin.
+
2025-05-04 Harald Anlauf <anlauf@gmx.de>
PR fortran/119986
diff --git a/gcc/testsuite/gcc.dg/pr120048.c b/gcc/testsuite/gcc.dg/pr120048.c
new file mode 100644
index 0000000..6bb34b0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr120048.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-vrp -fno-tree-fre" } */
+
+int a, b, c;
+static int d(short e) { return e || (a && e) ? 0 : a; }
+static void f(int e) {
+ if (!e) {
+ d(0);
+ b = d(e);
+ }
+}
+int main() { f(c | 1); }
diff --git a/gcc/testsuite/gcc.dg/pr120074.c b/gcc/testsuite/gcc.dg/pr120074.c
new file mode 100644
index 0000000..3f31516
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr120074.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/120074 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-tree-copy-prop -fno-tree-forwprop -fno-tree-ccp" } */
+
+int foo (int);
+short a;
+int b;
+
+int
+bar (int d, int e)
+{
+ return d < 0 || d > __INT_MAX__ >> e;
+}
+
+int
+main ()
+{
+ int f = bar ((b ^ a) & 3, __SIZEOF_INT__ * __CHAR_BIT__ - 2);
+ foo (f);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr111657-1.c b/gcc/testsuite/gcc.target/i386/pr111657-1.c
index 99acd1f..a4ba210 100644
--- a/gcc/testsuite/gcc.target/i386/pr111657-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr111657-1.c
@@ -1,5 +1,5 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -mno-sse -mtune=generic -masm=att" } */
+/* { dg-do assemble } */
+/* { dg-options "-O2 -mno-sse -mtune=generic -save-temps" } */
typedef unsigned long uword __attribute__ ((mode (word)));
@@ -8,5 +8,5 @@ struct a { uword arr[30]; };
__seg_gs struct a m;
void bar (struct a *dst) { *dst = m; }
-/* { dg-final { scan-assembler "rep\[; \t\]+movs(l|q)\[ \t\]+%gs:" { target { ! x32 } } } } */
-/* { dg-final { scan-assembler-not "rep\[; \t\]+movs(l|q)\[ \t\]+%gs:" { target x32 } } } */
+/* { dg-final { scan-assembler "gs\[ \t\]+rep\[; \t\]+movs(l|q)" { target { ! x32 } } } } */
+/* { dg-final { scan-assembler-not "gs\[ \t\]+rep\[; \t\]+movs(l|q)" { target x32 } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr120031.c b/gcc/testsuite/gcc.target/i386/pr120031.c
new file mode 100644
index 0000000..e329cbc2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr120031.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mbmi" } */
+
+unsigned int
+ZSTD_countTrailingZeros32_fallback (unsigned int val)
+{
+ static const unsigned int DeBruijn[32]
+ = { 0, 1, 28, 2, 29, 14, 24, 3,
+ 30, 22, 20, 15, 25, 17, 4, 8,
+ 31, 27, 13, 23, 21, 19, 16, 7,
+ 26, 12, 18, 6, 11, 5, 10, 9};
+ return DeBruijn[((unsigned int) ((val & -(int) val) * 0x077CB531U)) >> 27];
+}
+
+/* { dg-final { scan-assembler "tzcnt" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/pr119971.c b/gcc/testsuite/gcc.target/riscv/pr119971.c
new file mode 100644
index 0000000..c3f23b0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/pr119971.c
@@ -0,0 +1,24 @@
+/* { dg-do compile { target rv64 } } */
+/* { dg-options "-march=rv64gcb -mabi=lp64" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-g" "-Oz" "-Os" } } */
+
+__attribute__ ((noipa)) unsigned
+foo (unsigned b, unsigned e, unsigned i)
+{
+ e >>= b;
+ i >>= e & 31;
+ return i & 1;
+}
+
+int main()
+{
+ if (foo (0x18, 0xfe000000, 0x40000000) != 1)
+ __builtin_abort ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times "andi\t" 1 } } */
+/* { dg-final { scan-assembler-times "srlw\t" 2 } } */
+/* { dg-final { scan-assembler-not "bext\t" } } */
+
+
diff --git a/gcc/testsuite/gcc.target/riscv/zbb-rol-ror-03.c b/gcc/testsuite/gcc.target/riscv/zbb-rol-ror-03.c
index f85c20e..3121cb6 100644
--- a/gcc/testsuite/gcc.target/riscv/zbb-rol-ror-03.c
+++ b/gcc/testsuite/gcc.target/riscv/zbb-rol-ror-03.c
@@ -10,7 +10,7 @@ unsigned int rol(unsigned int rs1, unsigned int rs2)
}
unsigned int ror(unsigned int rs1, unsigned int rs2)
{
- int shamt = rs2 & (64 - 1);
+ int shamt = rs2 & (32 - 1);
return (rs1 >> shamt) | (rs1 << ((32 - shamt) & (32 - 1)));
}
diff --git a/gcc/testsuite/gm2/pim/pass/highbit.mod b/gcc/testsuite/gm2/pim/pass/highbit.mod
new file mode 100644
index 0000000..c9c872a
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/pass/highbit.mod
@@ -0,0 +1,13 @@
+MODULE highbit ;
+
+FROM libc IMPORT printf ;
+
+TYPE
+ set = BITSET ;
+
+CONST
+ HighBit = MAX (set) ;
+
+BEGIN
+ printf ("the MAX (set) = %d\n", HighBit)
+END highbit.
diff --git a/gcc/testsuite/gm2/pim/pass/highbit2.mod b/gcc/testsuite/gm2/pim/pass/highbit2.mod
new file mode 100644
index 0000000..940556d
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/pass/highbit2.mod
@@ -0,0 +1,13 @@
+MODULE highbit2 ;
+
+FROM libc IMPORT printf ;
+
+TYPE
+ set = BITSET ;
+
+CONST
+ HighBit = MAX (BITSET) ;
+
+BEGIN
+ printf ("the MAX (BITSET) = %d\n", HighBit)
+END highbit2.