aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog220
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-attribs.cc19
-rw-r--r--gcc/c/ChangeLog42
-rw-r--r--gcc/c/c-tree.h3
-rw-r--r--gcc/c/c-typeck.cc205
-rw-r--r--gcc/config/i386/i386.h34
-rw-r--r--gcc/config/i386/i386.md14
-rw-r--r--gcc/config/i386/predicates.md6
-rwxr-xr-xgcc/configure44
-rw-r--r--gcc/configure.ac29
-rw-r--r--gcc/cp/ChangeLog25
-rw-r--r--gcc/d/ChangeLog4
-rw-r--r--gcc/d/Make-lang.in2
-rw-r--r--gcc/doc/install.texi2
-rw-r--r--gcc/testsuite/ChangeLog109
-rw-r--r--gcc/testsuite/g++.dg/cpp26/constexpr-new3.C2
-rw-r--r--gcc/testsuite/gcc.dg/torture/hardbool-ai.c7
-rw-r--r--gcc/testsuite/gcc.dg/torture/hardbool-vi.c5
-rw-r--r--gcc/testsuite/gcc.dg/torture/hardbool.c68
-rw-r--r--gcc/testsuite/gcc.dg/vla-tert-1.c293
23 files changed, 975 insertions, 168 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d975768..b600551 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,223 @@
+2025-08-06 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/96226
+ * config/i386/predicates.md (and_operator): New operator.
+ * config/i386/i386.md (splitter after *<rotate_insn><mode>3_mask):
+ Use and_operator to match AND RTX and use its mode
+ in the split pattern.
+
+2025-08-06 Gerald Pfeifer <gerald@pfeifer.com>
+
+ PR target/69374
+ * doc/install.texi (Prerequisites): Replace bzip2 by xz.
+
+2025-08-06 Yangyu Chen <cyy@cyyself.name>
+
+ * config/i386/i386.h (PTA_BDVER1):
+ Add missing PTA_POPCNT and PTA_LZCNT with PTA_ABM.
+ (PTA_ZNVER1): Ditto.
+ (PTA_BTVER1): Ditto.
+ (PTA_LUJIAZUI): Ditto.
+ (PTA_YONGFENG): Do not include extra PTA_LZCNT.
+
+2025-08-06 Sam James <sam@gentoo.org>
+
+ PR libstdc++/29286
+ * Makefile.in (ALIASING_FLAGS): Drop.
+ * configure: Regenerate.
+ * configure.ac: Drop -fno-strict-aliasing workaround for < GCC 4.3.
+
+2025-08-06 Richard Biener <rguenther@suse.de>
+
+ * tree-vect-data-refs.cc (vect_supportable_dr_alignment):
+ Prune dead code.
+
+2025-08-06 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/121231
+ PR c++/119688
+ PR c++/94511
+ * common.opt: Document additional ABI version 21 change.
+ * doc/invoke.texi: Likewise.
+
+2025-08-06 Richard Biener <rguenther@suse.de>
+
+ * tree-vectorizer.h (_slp_tree::gs_scale): New.
+ (_slp_tree::gs_base): Likewise.
+ (SLP_TREE_GS_SCALE): Likewise.
+ (SLP_TREE_GS_BASE): Likewise.
+ (vect_describe_gather_scatter_call): Declare.
+ * tree-vect-slp.cc (_slp_tree::_slp_tree): Initialize
+ new members.
+ (vect_build_slp_tree_2): Record gather/scatter base and scale.
+ (vect_get_and_check_slp_defs): For gather/scatter IFNs
+ describe the call to first_gs_info.
+ * tree-vect-data-refs.cc (vect_gather_scatter_fn_p): Add
+ mode of operation with fixed offset vector type.
+ (vect_describe_gather_scatter_call): Export.
+ * tree-vect-stmts.cc (get_load_store_type): Do not call
+ vect_check_gather_scatter to fill gs_info, instead populate
+ from the SLP tree. Check which of, IFN, decl or fallback
+ is supported and record that decision.
+
+2025-08-06 Richard Biener <rguenther@suse.de>
+
+ * tree-vect-stmts.cc (vectorizable_store): Build proper
+ alias + align pointer value for gather/scatter and SLP
+ and use it.
+ (vectorizable_load): Likewise.
+
+2025-08-06 Richard Biener <rguenther@suse.de>
+
+ * tree-vect-stmts.cc (check_load_store_for_partial_vectors):
+ Remove redundant gather/scatter target support check, instead
+ check the recorded ifns. Also allow legacy gather/scatter
+ with loop masking.
+
+2025-08-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/121413
+ * gimple-lower-bitint.cc (gimple_lower_bitint): Fix up last
+ commit, cast limb_prec to unsigned before comparison.
+
+2025-08-06 Yang Yujie <yangyujie@loongson.cn>
+
+ * match.pd: Preserve conversion to _BitInt before a VCE
+ if the _BitInt is extended.
+
+2025-08-06 Yang Yujie <yangyujie@loongson.cn>
+
+ * gimple-lower-bitint.cc (bitint_large_huge::lower_mergeable_stmt):
+ Zero-extend the partial limb of any unsigned _BitInt LHS assigned
+ with a widening sign-extension.
+
+2025-08-06 Yang Yujie <yangyujie@loongson.cn>
+
+ * gimple-lower-bitint.cc (bitint_large_huge::limb_access):
+ Add a parameter abi_load_p. If set, load a limb directly
+ in its actual precision without casting from m_limb_type.
+ (struct bitint_large_huge): Same.
+ (bitint_large_huge::handle_load): Use.
+
+2025-08-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/121413
+ * gimple-lower-bitint.cc (abi_limb_prec): New variable
+ (bitint_precision_kind): Initialize it.
+ (gimple_lower_bitint): Clear it at the start. For
+ min_prec > limb_prec descreased precision vars for
+ INTEGER_CST PHI arguments ensure min_prec is either
+ prec or multiple of abi_limb_prec.
+
+2025-08-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/121127
+ * gimple-lower-bitint.cc (bitint_large_huge::handle_operand_addr): For
+ uninitialized SSA_NAME, set *prec_stored to 0 rather than *prec.
+ Handle that case in narrowing casts. If prec_stored is non-NULL,
+ set *prec_stored to prec_stored_val.
+
+2025-08-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/121386
+ * Makefile.in (gengtype-lex.cc): Append #define FLEX_SCANNER,
+ #include "system.h" and #undef FLEX_SCANNER to the prepended lines.
+ * gengtype-lex.l: Remove inclusion of config.h or bconfig.h, system.h
+ and definition of malloc/realloc from %{} section.
+
+2025-08-06 Kito Cheng <kito.cheng@sifive.com>
+
+ * config/riscv/arch-canonicalize: Read extension data from
+ riscv-ext*.def and adding unittest.
+
+2025-08-06 Kito Cheng <kito.cheng@sifive.com>
+
+ * common/config/riscv/riscv-common.cc (riscv_expand_arch):
+ Ignore `unset`.
+ * config/riscv/riscv.h (OPTION_DEFAULT_SPECS): Handle
+ `-march=unset`.
+ (ARCH_UNSET_CLEANUP_SPECS): New.
+ (DRIVER_SELF_SPECS): Handle -march=unset.
+ * doc/invoke.texi (RISC-V Options): Update documentation for
+ `-march=unset`.
+
+2025-08-06 Kwok Cheung Yeung <kcyeung@baylibre.com>
+
+ * gimplify.cc (remove_unused_omp_iterator_vars): Display unused
+ variable warning for 'to' and 'from' clauses.
+ (gimplify_scan_omp_clauses): Add argument for iterator loop sequence.
+ Gimplify the clause decl and size into the iterator loop if iterators
+ are used.
+ (gimplify_omp_workshare): Add argument for iterator loops sequence
+ in call to gimplify_scan_omp_clauses.
+ (gimplify_omp_target_update): Call remove_unused_omp_iterator_vars and
+ build_omp_iterators_loops. Add loop sequence as argument when calling
+ gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses and building
+ the Gimple statement.
+ * tree-pretty-print.cc (dump_omp_clause): Call dump_omp_iterators
+ for to/from clauses with iterators.
+ * tree.cc (omp_clause_num_ops): Add extra operand for OMP_CLAUSE_FROM
+ and OMP_CLAUSE_TO.
+ * tree.h (OMP_CLAUSE_HAS_ITERATORS): Add check for OMP_CLAUSE_TO and
+ OMP_CLAUSE_FROM.
+ (OMP_CLAUSE_ITERATORS): Likewise.
+
+2025-08-06 Kwok Cheung Yeung <kcyeung@baylibre.com>
+ Andrew Stubbs <ams@baylibre.com>
+
+ * gimple-pretty-print.cc (dump_gimple_omp_target): Print expanded
+ iterator loops.
+ * gimple.cc (gimple_build_omp_target): Add argument for iterator
+ loops sequence. Initialize iterator loops field.
+ * gimple.def (GIMPLE_OMP_TARGET): Set GSS symbol to GSS_OMP_TARGET.
+ * gimple.h (gomp_target): Set GSS symbol to GSS_OMP_TARGET. Add extra
+ field for iterator loops.
+ (gimple_build_omp_target): Add argument for iterator loops sequence.
+ (gimple_omp_target_iterator_loops): New.
+ (gimple_omp_target_iterator_loops_ptr): New.
+ (gimple_omp_target_set_iterator_loops): New.
+ * gimplify.cc (find_var_decl): New.
+ (copy_omp_iterator): New.
+ (remap_omp_iterator_var_1): New.
+ (remap_omp_iterator_var): New.
+ (remove_unused_omp_iterator_vars): New.
+ (struct iterator_loop_info_t): New type.
+ (iterator_loop_info_map_t): New type.
+ (build_omp_iterators_loops): New.
+ (enter_omp_iterator_loop_context_1): New.
+ (enter_omp_iterator_loop_context): New.
+ (enter_omp_iterator_loop_context): New.
+ (exit_omp_iterator_loop_context): New.
+ (gimplify_adjust_omp_clauses): Add argument for iterator loop
+ sequence. Gimplify the clause decl and size into the iterator
+ loop if iterators are used.
+ (gimplify_omp_workshare): Call remove_unused_omp_iterator_vars and
+ build_omp_iterators_loops for OpenMP target expressions. Add
+ loop sequence as argument when calling gimplify_adjust_omp_clauses
+ and building the Gimple statement.
+ * gimplify.h (enter_omp_iterator_loop_context): New prototype.
+ (exit_omp_iterator_loop_context): New prototype.
+ * gsstruct.def (GSS_OMP_TARGET): New.
+ * omp-low.cc (lower_omp_map_iterator_expr): New.
+ (lower_omp_map_iterator_size): New.
+ (finish_omp_map_iterators): New.
+ (lower_omp_target): Add sorry if iterators used with deep mapping.
+ Call lower_omp_map_iterator_expr before assigning to sender ref.
+ Call lower_omp_map_iterator_size before setting the size. Insert
+ iterator loop sequence before the statements for the target clause.
+ * tree-nested.cc (convert_nonlocal_reference_stmt): Walk the iterator
+ loop sequence of OpenMP target statements.
+ (convert_local_reference_stmt): Likewise.
+ (convert_tramp_reference_stmt): Likewise.
+ * tree-pretty-print.cc (dump_omp_iterators): Dump extra iterator
+ information if present.
+ (dump_omp_clause): Call dump_omp_iterators for iterators in map
+ clauses.
+ * tree.cc (omp_clause_num_ops): Add operand for OMP_CLAUSE_MAP.
+ (walk_tree_1): Do not walk last operand of OMP_CLAUSE_MAP.
+ * tree.h (OMP_CLAUSE_HAS_ITERATORS): New.
+ (OMP_CLAUSE_ITERATORS): New.
+
2025-08-05 H.J. Lu <hjl.tools@gmail.com>
PR target/121410
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index cf43af9..d4024d7 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20250806
+20250807
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 3406517..cc79595 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -187,8 +187,6 @@ C_STRICT_WARN = @c_strict_warn@
NOEXCEPTION_FLAGS = @noexception_flags@
-ALIASING_FLAGS = @aliasing_flags@
-
# This is set by --disable-maintainer-mode (default) to "#"
# FIXME: 'MAINT' will always be set to an empty string, no matter if
# --disable-maintainer-mode is used or not. This is because the
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index c9ab153..2abe6df 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2025-08-06 Alexandre Oliva <oliva@adacore.com>
+
+ * c-attribs.cc (handle_hardbool_attribute): Create distinct
+ enumeration types, with structural equality. Handle
+ base type qualifiers.
+
2025-08-02 Martin Uecker <uecker@tugraz.at>
* c-attribs.cc (handle_argspec_attribute): Update.
diff --git a/gcc/c-family/c-attribs.cc b/gcc/c-family/c-attribs.cc
index a0d832b..041a004 100644
--- a/gcc/c-family/c-attribs.cc
+++ b/gcc/c-family/c-attribs.cc
@@ -1128,11 +1128,16 @@ handle_hardbool_attribute (tree *node, tree name, tree args,
}
tree orig = *node;
- *node = build_duplicate_type (orig);
+ /* Drop qualifiers from the base type. Keep attributes, so that, in the odd
+ chance attributes are applicable and relevant to the base type, if they
+ are specified first, or through a typedef, they wouldn't be dropped on the
+ floor here. */
+ tree unqual = build_qualified_type (orig, TYPE_UNQUALIFIED);
+ *node = build_distinct_type_copy (unqual);
TREE_SET_CODE (*node, ENUMERAL_TYPE);
- ENUM_UNDERLYING_TYPE (*node) = orig;
- TYPE_CANONICAL (*node) = TYPE_CANONICAL (orig);
+ ENUM_UNDERLYING_TYPE (*node) = unqual;
+ SET_TYPE_STRUCTURAL_EQUALITY (*node);
tree false_value;
if (args)
@@ -1191,7 +1196,13 @@ handle_hardbool_attribute (tree *node, tree name, tree args,
gcc_checking_assert (!TYPE_CACHED_VALUES_P (*node));
TYPE_VALUES (*node) = values;
- TYPE_NAME (*node) = orig;
+ TYPE_NAME (*node) = unqual;
+
+ if (TYPE_QUALS (orig) != TYPE_QUALS (*node))
+ {
+ *node = build_qualified_type (*node, TYPE_QUALS (orig));
+ TYPE_NAME (*node) = orig;
+ }
return NULL_TREE;
}
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 464e5a1..2e5c896 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,45 @@
+2025-08-06 Alexandre Oliva <oliva@adacore.com>
+
+ * c-tree.h (C_BOOLEAN_TYPE_P): Cover hardbools as well.
+ * c-typeck.cc (convert_lvalue_to_rvalue): New overload and
+ wrapper.
+ (build_atomic_assign, build_modify_expr): Use it.
+ (build_asm_expr, handle_omp-array_sections_1): Simplify with
+ it.
+ (build_unary_op): Handle hardbools.
+
+2025-08-06 Martin Uecker <uecker@tugraz.at>
+
+ PR c/108931
+ * c-typeck.cc (composite_type_cond): Renamed from
+ composite_type with argument for condition
+ (composite_type): New function.
+ (composite_type_internal): Implement new logic.
+ (build_conditional_expr): Pass condition.
+ (common_pointer_type): Adapt.
+ (pointer_diff): Adapt.
+ (build_binary_op): Adapt.
+
+2025-08-06 Martin Uecker <uecker@tugraz.at>
+
+ PR c/121217
+ * c-typeck.cc (tagged_types_tu_compatible_p): Add check.
+
+2025-08-06 Kwok Cheung Yeung <kcyeung@baylibre.com>
+
+ * c-parser.cc (c_parser_omp_clause_from_to): Parse 'iterator' modifier.
+ * c-typeck.cc (c_finish_omp_clauses): Finish iterators for to/from
+ clauses.
+
+2025-08-06 Kwok Cheung Yeung <kcyeung@baylibre.com>
+ Andrew Stubbs <ams@baylibre.com>
+
+ * c-parser.cc (c_parser_omp_variable_list): Use location of the
+ map expression as the clause location.
+ (c_parser_omp_clause_map): Parse 'iterator' modifier.
+ * c-typeck.cc (c_finish_omp_clauses): Finish iterators. Apply
+ iterators to generated clauses.
+
2025-08-02 Martin Uecker <uecker@tugraz.at>
* c-decl.cc (get_parm_array_spec): Remove.
diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h
index bb0b113..dba94ab 100644
--- a/gcc/c/c-tree.h
+++ b/gcc/c/c-tree.h
@@ -163,7 +163,8 @@ along with GCC; see the file COPYING3. If not see
(TREE_CODE (TYPE) == BOOLEAN_TYPE \
|| (TREE_CODE (TYPE) == ENUMERAL_TYPE \
&& ENUM_UNDERLYING_TYPE (TYPE) != NULL_TREE \
- && TREE_CODE (ENUM_UNDERLYING_TYPE (TYPE)) == BOOLEAN_TYPE))
+ && (TREE_CODE (ENUM_UNDERLYING_TYPE (TYPE)) == BOOLEAN_TYPE \
+ || c_hardbool_type_attr (TYPE))))
/* Record parser information about an expression that is irrelevant
for code generation alongside a tree representing its value. */
diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index e0d0a44..7a95f72 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -641,7 +641,8 @@ struct composite_cache {
};
tree
-composite_type_internal (tree t1, tree t2, struct composite_cache* cache)
+composite_type_internal (tree t1, tree t2, tree cond,
+ struct composite_cache* cache)
{
enum tree_code code1;
enum tree_code code2;
@@ -686,8 +687,8 @@ composite_type_internal (tree t1, tree t2, struct composite_cache* cache)
{
tree pointed_to_1 = TREE_TYPE (t1);
tree pointed_to_2 = TREE_TYPE (t2);
- tree target = composite_type_internal (pointed_to_1,
- pointed_to_2, cache);
+ tree target = composite_type_internal (pointed_to_1, pointed_to_2,
+ cond, cache);
t1 = c_build_pointer_type_for_mode (target, TYPE_MODE (t1), false);
t1 = c_build_type_attribute_variant (t1, attributes);
return qualify_type (t1, t2);
@@ -695,25 +696,20 @@ composite_type_internal (tree t1, tree t2, struct composite_cache* cache)
case ARRAY_TYPE:
{
- tree elt = composite_type_internal (TREE_TYPE (t1), TREE_TYPE (t2),
- cache);
- int quals;
- tree unqual_elt;
tree d1 = TYPE_DOMAIN (t1);
tree d2 = TYPE_DOMAIN (t2);
- bool d1_variable, d2_variable;
- bool d1_zero, d2_zero;
- bool t1_complete, t2_complete;
/* We should not have any type quals on arrays at all. */
gcc_assert (!TYPE_QUALS_NO_ADDR_SPACE (t1)
&& !TYPE_QUALS_NO_ADDR_SPACE (t2));
- t1_complete = COMPLETE_TYPE_P (t1);
- t2_complete = COMPLETE_TYPE_P (t2);
+ bool t1_complete = COMPLETE_TYPE_P (t1);
+ bool t2_complete = COMPLETE_TYPE_P (t2);
- d1_zero = d1 == NULL_TREE || !TYPE_MAX_VALUE (d1);
- d2_zero = d2 == NULL_TREE || !TYPE_MAX_VALUE (d2);
+ bool d1_zero = d1 == NULL_TREE || !TYPE_MAX_VALUE (d1);
+ bool d2_zero = d2 == NULL_TREE || !TYPE_MAX_VALUE (d2);
+
+ bool d1_variable, d2_variable;
d1_variable = (!d1_zero
&& (TREE_CODE (TYPE_MIN_VALUE (d1)) != INTEGER_CST
@@ -722,10 +718,8 @@ composite_type_internal (tree t1, tree t2, struct composite_cache* cache)
&& (TREE_CODE (TYPE_MIN_VALUE (d2)) != INTEGER_CST
|| TREE_CODE (TYPE_MAX_VALUE (d2)) != INTEGER_CST));
- bool use1 = TYPE_DOMAIN (t1)
- && (d2_variable || d2_zero || !d1_variable);
- bool use2 = TYPE_DOMAIN (t2)
- && (d1_variable || d1_zero || !d2_variable);
+ bool use1 = d1 && (d2_variable || d2_zero || !d1_variable);
+ bool use2 = d2 && (d1_variable || d1_zero || !d2_variable);
/* If the first is an unspecified size pick the other one. */
if (d2_variable && c_type_unspecified_p (t1))
@@ -734,25 +728,53 @@ composite_type_internal (tree t1, tree t2, struct composite_cache* cache)
use1 = false;
}
- /* Save space: see if the result is identical to one of the args. */
- if (elt == TREE_TYPE (t1) && use1)
- return c_build_type_attribute_variant (t1, attributes);
- if (elt == TREE_TYPE (t2) && use2)
- return c_build_type_attribute_variant (t2, attributes);
+ /* If both are VLAs but not unspecified and we are in the
+ conditional operator, we create a conditional to select
+ the size of the active branch. */
+ bool use0 = cond && d1_variable && !c_type_unspecified_p (t1)
+ && d2_variable && !c_type_unspecified_p (t2);
+
+ tree td;
+ tree elt = composite_type_internal (TREE_TYPE (t1), TREE_TYPE (t2),
+ cond, cache);
+
+ if (!use0)
+ {
+ /* Save space: see if the result is identical to one of the args. */
+ if (elt == TREE_TYPE (t1) && use1)
+ return c_build_type_attribute_variant (t1, attributes);
+ if (elt == TREE_TYPE (t2) && use2)
+ return c_build_type_attribute_variant (t2, attributes);
+
+ if (elt == TREE_TYPE (t1) && !TYPE_DOMAIN (t2) && !TYPE_DOMAIN (t1))
+ return c_build_type_attribute_variant (t1, attributes);
+ if (elt == TREE_TYPE (t2) && !TYPE_DOMAIN (t2) && !TYPE_DOMAIN (t1))
+ return c_build_type_attribute_variant (t2, attributes);
+
+ td = TYPE_DOMAIN (use1 ? t1 : t2);
+ }
+ else
+ {
+ /* Not used in C. */
+ gcc_assert (size_zero_node == TYPE_MIN_VALUE (d1));
+ gcc_assert (size_zero_node == TYPE_MIN_VALUE (d2));
+
+ tree d = fold_build3_loc (UNKNOWN_LOCATION, COND_EXPR, sizetype,
+ cond, TYPE_MAX_VALUE (d1),
+ TYPE_MAX_VALUE (d2));
- if (elt == TREE_TYPE (t1) && !TYPE_DOMAIN (t2) && !TYPE_DOMAIN (t1))
- return c_build_type_attribute_variant (t1, attributes);
- if (elt == TREE_TYPE (t2) && !TYPE_DOMAIN (t2) && !TYPE_DOMAIN (t1))
- return c_build_type_attribute_variant (t2, attributes);
+ td = build_index_type (d);
+ }
/* Merge the element types, and have a size if either arg has
one. We may have qualifiers on the element types. To set
up TYPE_MAIN_VARIANT correctly, we need to form the
composite of the unqualified types and add the qualifiers
back at the end. */
- quals = TYPE_QUALS (strip_array_types (elt));
- unqual_elt = c_build_qualified_type (elt, TYPE_UNQUALIFIED);
- t1 = c_build_array_type (unqual_elt, TYPE_DOMAIN (use1 ? t1 : t2));
+ int quals = TYPE_QUALS (strip_array_types (elt));
+ tree unqual_elt = c_build_qualified_type (elt, TYPE_UNQUALIFIED);
+
+ t1 = c_build_array_type (unqual_elt, td);
/* Check that a type which has a varying outermost dimension
got marked has having a variable size. */
@@ -819,7 +841,7 @@ composite_type_internal (tree t1, tree t2, struct composite_cache* cache)
gcc_assert (DECL_NAME (a) == DECL_NAME (b));
gcc_checking_assert (!DECL_NAME (a) || comptypes (ta, tb));
- tree t = composite_type_internal (ta, tb, cache);
+ tree t = composite_type_internal (ta, tb, cond, cache);
tree f = build_decl (input_location, FIELD_DECL, DECL_NAME (a), t);
DECL_PACKED (f) = DECL_PACKED (a);
@@ -876,8 +898,8 @@ composite_type_internal (tree t1, tree t2, struct composite_cache* cache)
/* Function types: prefer the one that specified arg types.
If both do, merge the arg types. Also merge the return types. */
{
- tree valtype = composite_type_internal (TREE_TYPE (t1),
- TREE_TYPE (t2), cache);
+ tree valtype = composite_type_internal (TREE_TYPE (t1), TREE_TYPE (t2),
+ cond, cache);
tree p1 = TYPE_ARG_TYPES (t1);
tree p2 = TYPE_ARG_TYPES (t2);
int len;
@@ -956,7 +978,7 @@ composite_type_internal (tree t1, tree t2, struct composite_cache* cache)
{
TREE_VALUE (n) = composite_type_internal (TREE_TYPE (memb),
TREE_VALUE (p2),
- cache);
+ cond, cache);
pedwarn (input_location, OPT_Wpedantic,
"function types not truly compatible in ISO C");
goto parm_done;
@@ -979,14 +1001,14 @@ composite_type_internal (tree t1, tree t2, struct composite_cache* cache)
TREE_VALUE (n)
= composite_type_internal (TREE_TYPE (memb),
TREE_VALUE (p1),
- cache);
+ cond, cache);
pedwarn (input_location, OPT_Wpedantic,
"function types not truly compatible in ISO C");
goto parm_done;
}
}
}
- TREE_VALUE (n) = composite_type_internal (mv1, mv2, cache);
+ TREE_VALUE (n) = composite_type_internal (mv1, mv2, cond, cache);
parm_done: ;
}
@@ -1001,18 +1023,25 @@ composite_type_internal (tree t1, tree t2, struct composite_cache* cache)
}
tree
-composite_type (tree t1, tree t2)
+composite_type_cond (tree t1, tree t2, tree cond)
{
gcc_checking_assert (comptypes_check_for_composite (t1, t2));
struct composite_cache cache = { };
- tree n = composite_type_internal (t1, t2, &cache);
+ tree n = composite_type_internal (t1, t2, cond, &cache);
gcc_checking_assert (comptypes_check_for_composite (n, t1));
gcc_checking_assert (comptypes_check_for_composite (n, t2));
return n;
}
+
+tree
+composite_type (tree t1, tree t2)
+{
+ return composite_type_cond (t1, t2, NULL_TREE);
+}
+
/* Return the type of a conditional expression between pointers to
possibly differently qualified versions of compatible types.
@@ -1020,7 +1049,7 @@ composite_type (tree t1, tree t2)
true; if that isn't so, this may crash. */
static tree
-common_pointer_type (tree t1, tree t2)
+common_pointer_type (tree t1, tree t2, tree cond)
{
tree attributes;
unsigned target_quals;
@@ -1047,8 +1076,8 @@ common_pointer_type (tree t1, tree t2)
qualifiers of the two types' targets. */
tree pointed_to_1 = TREE_TYPE (t1);
tree pointed_to_2 = TREE_TYPE (t2);
- tree target = composite_type (TYPE_MAIN_VARIANT (pointed_to_1),
- TYPE_MAIN_VARIANT (pointed_to_2));
+ tree target = composite_type_cond (TYPE_MAIN_VARIANT (pointed_to_1),
+ TYPE_MAIN_VARIANT (pointed_to_2), cond);
/* Strip array types to get correct qualifier for pointers to arrays */
quals1 = TYPE_QUALS_NO_ADDR_SPACE (strip_array_types (pointed_to_1));
@@ -2651,6 +2680,20 @@ convert_lvalue_to_rvalue (location_t loc, struct c_expr exp,
return exp;
}
+/* Wrapper for the overload above, same arguments but for tree rather than
+ c_expr. This is important for hardbools to decay to bools. */
+
+static inline tree
+convert_lvalue_to_rvalue (location_t loc, tree val,
+ bool convert_p, bool read_p, bool for_init = false)
+{
+ struct c_expr expr;
+ memset (&expr, 0, sizeof (expr));
+ expr.value = val;
+ expr = convert_lvalue_to_rvalue (loc, expr, convert_p, read_p, for_init);
+ return expr.value;
+}
+
/* EXP is an expression of integer type. Apply the integer promotions
to it and return the promoted value. */
@@ -4929,7 +4972,7 @@ pointer_diff (location_t loc, tree op0, tree op1, tree *instrument_expr)
if (!addr_space_superset (as0, as1, &as_common))
gcc_unreachable ();
- common_type = common_pointer_type (TREE_TYPE (op0), TREE_TYPE (op1));
+ common_type = common_pointer_type (TREE_TYPE (op0), TREE_TYPE (op1), NULL_TREE);
op0 = convert (common_type, op0);
op1 = convert (common_type, op1);
}
@@ -5274,7 +5317,9 @@ cas_loop:
/* newval = old + val; */
if (rhs_type != rhs_semantic_type)
val = build1 (EXCESS_PRECISION_EXPR, nonatomic_rhs_semantic_type, val);
- rhs = build_binary_op (loc, modifycode, old, val, true);
+ rhs = build_binary_op (loc, modifycode,
+ convert_lvalue_to_rvalue (loc, old, true, true),
+ val, true);
if (TREE_CODE (rhs) == EXCESS_PRECISION_EXPR)
{
tree eptype = TREE_TYPE (rhs);
@@ -5730,7 +5775,48 @@ build_unary_op (location_t location, enum tree_code code, tree xarg,
goto return_build_unary_op;
}
- if (C_BOOLEAN_TYPE_P (TREE_TYPE (arg)))
+ tree true_res;
+ if (c_hardbool_type_attr (TREE_TYPE (arg), NULL, &true_res))
+ {
+ tree larg = stabilize_reference (arg);
+ tree sarg = save_expr (larg);
+ switch (code)
+ {
+ case PREINCREMENT_EXPR:
+ val = build2 (MODIFY_EXPR, TREE_TYPE (larg), larg, true_res);
+ val = build2 (COMPOUND_EXPR, TREE_TYPE (larg), sarg, val);
+ break;
+ case POSTINCREMENT_EXPR:
+ val = build2 (MODIFY_EXPR, TREE_TYPE (larg), larg, true_res);
+ val = build2 (COMPOUND_EXPR, TREE_TYPE (larg), val, sarg);
+ val = build2 (COMPOUND_EXPR, TREE_TYPE (larg), sarg, val);
+ break;
+ case PREDECREMENT_EXPR:
+ {
+ tree rarg = convert_lvalue_to_rvalue (location, sarg,
+ true, true);
+ rarg = invert_truthvalue_loc (location, rarg);
+ rarg = convert (TREE_TYPE (sarg), rarg);
+ val = build2 (MODIFY_EXPR, TREE_TYPE (larg), larg, rarg);
+ }
+ break;
+ case POSTDECREMENT_EXPR:
+ {
+ tree rarg = convert_lvalue_to_rvalue (location, sarg,
+ true, true);
+ rarg = invert_truthvalue_loc (location, rarg);
+ tree iarg = convert (TREE_TYPE (larg), rarg);
+ val = build2 (MODIFY_EXPR, TREE_TYPE (larg), larg, iarg);
+ val = build2 (COMPOUND_EXPR, TREE_TYPE (larg), val, sarg);
+ val = build2 (COMPOUND_EXPR, TREE_TYPE (larg), sarg, val);
+ }
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ TREE_SIDE_EFFECTS (val) = 1;
+ }
+ else if (C_BOOLEAN_TYPE_P (TREE_TYPE (arg)))
val = boolean_increment (code, arg);
else
val = build2 (code, TREE_TYPE (arg), arg, inc);
@@ -6383,7 +6469,10 @@ build_conditional_expr (location_t colon_loc, tree ifexp, bool ifexp_bcp,
addr_space_t as_common;
if (comp_target_types (colon_loc, type1, type2))
- result_type = common_pointer_type (type1, type2);
+ {
+ ifexp = save_expr (ifexp);
+ result_type = common_pointer_type (type1, type2, ifexp);
+ }
else if (null_pointer_constant_p (orig_op1))
result_type = type2;
else if (null_pointer_constant_p (orig_op2))
@@ -7340,8 +7429,10 @@ build_modify_expr (location_t location, tree lhs, tree lhs_origtype,
clear_decl_read = true;
}
- newrhs = build_binary_op (location,
- modifycode, lhs, newrhs, true);
+ newrhs = build_binary_op (location, modifycode,
+ convert_lvalue_to_rvalue (location, lhs,
+ true, true),
+ newrhs, true);
if (clear_decl_read)
DECL_READ_P (lhs) = 0;
@@ -12733,11 +12824,9 @@ build_asm_expr (location_t loc, tree string, tree outputs, tree inputs,
}
else
{
- struct c_expr expr;
- memset (&expr, 0, sizeof (expr));
- expr.value = input;
- expr = convert_lvalue_to_rvalue (loc, expr, true, false);
- input = c_fully_fold (expr.value, false, NULL);
+ input = c_fully_fold (convert_lvalue_to_rvalue (loc, input,
+ true, false),
+ false, NULL);
if (input != error_mark_node && VOID_TYPE_P (TREE_TYPE (input)))
{
@@ -14393,7 +14482,7 @@ build_binary_op (location_t location, enum tree_code code,
Otherwise, the targets must be compatible
and both must be object or both incomplete. */
if (comp_target_types (location, type0, type1))
- result_type = common_pointer_type (type0, type1);
+ result_type = common_pointer_type (type0, type1, NULL_TREE);
else if (!addr_space_superset (as0, as1, &as_common))
{
error_at (location, "comparison of pointers to "
@@ -14532,7 +14621,7 @@ build_binary_op (location_t location, enum tree_code code,
if (comp_target_types (location, type0, type1))
{
- result_type = common_pointer_type (type0, type1);
+ result_type = common_pointer_type (type0, type1, NULL_TREE);
if (!COMPLETE_TYPE_P (TREE_TYPE (type0))
!= !COMPLETE_TYPE_P (TREE_TYPE (type1)))
pedwarn_c99 (location, OPT_Wpedantic,
@@ -15359,12 +15448,8 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
/* If the array section is pointer based and the pointer
itself is _Atomic qualified, we need to atomically load
the pointer. */
- c_expr expr;
- memset (&expr, 0, sizeof (expr));
- expr.value = ret;
- expr = convert_lvalue_to_rvalue (OMP_CLAUSE_LOCATION (c),
- expr, false, false);
- ret = expr.value;
+ ret = convert_lvalue_to_rvalue (OMP_CLAUSE_LOCATION (c),
+ ret, false, false);
}
return ret;
}
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 791f3b9..49af963 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2477,9 +2477,9 @@ constexpr wide_int_bitmask PTA_DIAMONDRAPIDS = PTA_GRANITERAPIDS_D
| PTA_MOVRS | PTA_AMX_MOVRS | PTA_USER_MSR;
constexpr wide_int_bitmask PTA_BDVER1 = PTA_64BIT | PTA_MMX | PTA_SSE
- | PTA_SSE2 | PTA_SSE3 | PTA_SSE4A | PTA_CX16 | PTA_ABM | PTA_SSSE3
- | PTA_SSE4_1 | PTA_SSE4_2 | PTA_AES | PTA_PCLMUL | PTA_AVX | PTA_FMA4
- | PTA_XOP | PTA_LWP | PTA_PRFCHW | PTA_FXSR | PTA_XSAVE;
+ | PTA_SSE2 | PTA_SSE3 | PTA_SSE4A | PTA_CX16 | PTA_POPCNT | PTA_LZCNT
+ | PTA_ABM | PTA_SSSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_AES | PTA_PCLMUL
+ | PTA_AVX | PTA_FMA4 | PTA_XOP | PTA_LWP | PTA_PRFCHW | PTA_FXSR | PTA_XSAVE;
constexpr wide_int_bitmask PTA_BDVER2 = PTA_BDVER1 | PTA_BMI | PTA_TBM
| PTA_F16C | PTA_FMA;
constexpr wide_int_bitmask PTA_BDVER3 = PTA_BDVER2 | PTA_XSAVEOPT
@@ -2487,13 +2487,13 @@ constexpr wide_int_bitmask PTA_BDVER3 = PTA_BDVER2 | PTA_XSAVEOPT
constexpr wide_int_bitmask PTA_BDVER4 = PTA_BDVER3 | PTA_AVX2 | PTA_BMI2
| PTA_RDRND | PTA_MOVBE | PTA_MWAITX;
-constexpr wide_int_bitmask PTA_ZNVER1 = PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2
- | PTA_SSE3 | PTA_SSE4A | PTA_CX16 | PTA_ABM | PTA_SSSE3 | PTA_SSE4_1
- | PTA_SSE4_2 | PTA_AES | PTA_PCLMUL | PTA_AVX | PTA_AVX2 | PTA_BMI | PTA_BMI2
- | PTA_F16C | PTA_FMA | PTA_PRFCHW | PTA_FXSR | PTA_XSAVE | PTA_XSAVEOPT
- | PTA_FSGSBASE | PTA_RDRND | PTA_MOVBE | PTA_MWAITX | PTA_ADX | PTA_RDSEED
- | PTA_CLZERO | PTA_CLFLUSHOPT | PTA_XSAVEC | PTA_XSAVES | PTA_SHA | PTA_LZCNT
- | PTA_POPCNT;
+constexpr wide_int_bitmask PTA_ZNVER1 = PTA_64BIT | PTA_MMX | PTA_SSE
+ | PTA_SSE2 | PTA_SSE3 | PTA_SSE4A | PTA_CX16 | PTA_POPCNT | PTA_LZCNT
+ | PTA_ABM | PTA_SSSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_AES | PTA_PCLMUL
+ | PTA_AVX | PTA_AVX2 | PTA_BMI | PTA_BMI2 | PTA_F16C | PTA_FMA | PTA_PRFCHW
+ | PTA_FXSR | PTA_XSAVE | PTA_XSAVEOPT | PTA_FSGSBASE | PTA_RDRND | PTA_MOVBE
+ | PTA_MWAITX | PTA_ADX | PTA_RDSEED | PTA_CLZERO | PTA_CLFLUSHOPT
+ | PTA_XSAVEC | PTA_XSAVES | PTA_SHA;
constexpr wide_int_bitmask PTA_ZNVER2 = PTA_ZNVER1 | PTA_CLWB | PTA_RDPID
| PTA_WBNOINVD;
constexpr wide_int_bitmask PTA_ZNVER3 = PTA_ZNVER2 | PTA_VAES | PTA_VPCLMULQDQ
@@ -2506,19 +2506,19 @@ constexpr wide_int_bitmask PTA_ZNVER5 = PTA_ZNVER4 | PTA_AVXVNNI
| PTA_MOVDIRI | PTA_MOVDIR64B | PTA_AVX512VP2INTERSECT | PTA_PREFETCHI;
constexpr wide_int_bitmask PTA_BTVER1 = PTA_64BIT | PTA_MMX | PTA_SSE
- | PTA_SSE2 | PTA_SSE3 | PTA_SSSE3 | PTA_SSE4A | PTA_ABM | PTA_CX16
- | PTA_PRFCHW | PTA_FXSR | PTA_XSAVE;
+ | PTA_SSE2 | PTA_SSE3 | PTA_SSSE3 | PTA_SSE4A | PTA_LZCNT | PTA_POPCNT
+ | PTA_ABM | PTA_CX16 | PTA_PRFCHW | PTA_FXSR | PTA_XSAVE;
constexpr wide_int_bitmask PTA_BTVER2 = PTA_BTVER1 | PTA_SSE4_1 | PTA_SSE4_2
| PTA_AES | PTA_PCLMUL | PTA_AVX | PTA_BMI | PTA_F16C | PTA_MOVBE
| PTA_XSAVEOPT;
constexpr wide_int_bitmask PTA_LUJIAZUI = PTA_64BIT | PTA_MMX | PTA_SSE
- | PTA_SSE2 | PTA_SSE3 | PTA_CX16 | PTA_ABM | PTA_SSSE3 | PTA_SSE4_1
- | PTA_SSE4_2 | PTA_AES | PTA_PCLMUL | PTA_BMI | PTA_BMI2 | PTA_PRFCHW
- | PTA_FXSR | PTA_XSAVE | PTA_XSAVEOPT | PTA_FSGSBASE | PTA_RDRND | PTA_MOVBE
- | PTA_ADX | PTA_RDSEED | PTA_POPCNT;
+ | PTA_SSE2 | PTA_SSE3 | PTA_CX16 | PTA_LZCNT | PTA_POPCNT | PTA_ABM
+ | PTA_SSSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_AES | PTA_PCLMUL | PTA_BMI
+ | PTA_BMI2 | PTA_PRFCHW | PTA_FXSR | PTA_XSAVE | PTA_XSAVEOPT | PTA_FSGSBASE
+ | PTA_RDRND | PTA_MOVBE | PTA_ADX | PTA_RDSEED;
constexpr wide_int_bitmask PTA_YONGFENG = PTA_LUJIAZUI | PTA_AVX | PTA_AVX2
- | PTA_F16C | PTA_FMA | PTA_SHA | PTA_LZCNT;
+ | PTA_F16C | PTA_FMA | PTA_SHA;
#ifndef GENERATOR_FILE
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 2b0dd66..6686f10 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -18298,17 +18298,17 @@
(any_rotate:SWI
(match_operand:SWI 1 "const_int_operand")
(subreg:QI
- (and
- (match_operand 2 "int248_register_operand")
- (match_operand 3 "const_int_operand")) 0)))]
+ (match_operator 4 "and_operator"
+ [(match_operand 2 "int248_register_operand")
+ (match_operand 3 "const_int_operand")]) 0)))]
"(INTVAL (operands[3]) & (GET_MODE_BITSIZE (<MODE>mode) - 1))
== GET_MODE_BITSIZE (<MODE>mode) - 1"
- [(set (match_dup 4) (match_dup 1))
+ [(set (match_dup 5) (match_dup 1))
(set (match_dup 0)
- (any_rotate:SWI (match_dup 4)
+ (any_rotate:SWI (match_dup 5)
(subreg:QI
- (and:SI (match_dup 2) (match_dup 3)) 0)))]
- "operands[4] = gen_reg_rtx (<MODE>mode);")
+ (match_op_dup 4 [(match_dup 2) (match_dup 3)]) 0)))]
+ "operands[5] = gen_reg_rtx (<MODE>mode);")
(define_insn_and_split "*<insn><mode>3_mask_1"
[(set (match_operand:SWI 0 "nonimmediate_operand")
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 0f31090..175798c 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -1714,10 +1714,14 @@
(define_predicate "div_operator"
(match_code "div"))
-;; Return true if this is a and, ior or xor operation.
+;; Return true if this is an and, ior or xor operation.
(define_predicate "logic_operator"
(match_code "and,ior,xor"))
+;; Return true if this is an and operation.
+(define_predicate "and_operator"
+ (match_code "and"))
+
;; Return true if this is a plus, minus, and, ior or xor operation.
(define_predicate "plusminuslogic_operator"
(match_code "plus,minus,and,ior,xor"))
diff --git a/gcc/configure b/gcc/configure
index bacdd29..cab9c75 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -872,7 +872,6 @@ c_strict_warn
strict_warn
c_loose_warn
loose_warn
-aliasing_flags
CPP
EGREP
GREP
@@ -7126,45 +7125,6 @@ $as_echo "#define HAVE_SWAP_IN_UTILITY 1" >>confdefs.h
fi
-# Check whether compiler is affected by placement new aliasing bug (PR 29286).
-# If the host compiler is affected by the bug, and we build with optimization
-# enabled (which happens e.g. when cross-compiling), the pool allocator may
-# get miscompiled. Use -fno-strict-aliasing to work around this problem.
-# Since there is no reliable feature check for the presence of this bug,
-# we simply use a GCC version number check. (This should never trigger for
-# stages 2 or 3 of a native bootstrap.)
-aliasing_flags=
-if test "$GCC" = yes; then
- saved_CXXFLAGS="$CXXFLAGS"
-
- # The following test compilation will succeed if and only if $CXX accepts
- # -fno-strict-aliasing *and* is older than GCC 4.3.
- CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX is affected by placement new aliasing bug" >&5
-$as_echo_n "checking whether $CXX is affected by placement new aliasing bug... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
-#error compiler not affected by placement new aliasing bug
-#endif
-
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }; aliasing_flags='-fno-strict-aliasing'
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
- CXXFLAGS="$saved_CXXFLAGS"
-fi
-
-
-
-
# ---------------------
# Warnings and checking
# ---------------------
@@ -21522,7 +21482,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 21525 "configure"
+#line 21485 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -21628,7 +21588,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 21631 "configure"
+#line 21591 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 2c43b38..ac1f0e9 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -563,35 +563,6 @@ if test $ac_cv_std_swap_in_utility = yes; then
[Define if <utility> defines std::swap.])
fi
-# Check whether compiler is affected by placement new aliasing bug (PR 29286).
-# If the host compiler is affected by the bug, and we build with optimization
-# enabled (which happens e.g. when cross-compiling), the pool allocator may
-# get miscompiled. Use -fno-strict-aliasing to work around this problem.
-# Since there is no reliable feature check for the presence of this bug,
-# we simply use a GCC version number check. (This should never trigger for
-# stages 2 or 3 of a native bootstrap.)
-aliasing_flags=
-if test "$GCC" = yes; then
- saved_CXXFLAGS="$CXXFLAGS"
-
- # The following test compilation will succeed if and only if $CXX accepts
- # -fno-strict-aliasing *and* is older than GCC 4.3.
- CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
- AC_MSG_CHECKING([whether $CXX is affected by placement new aliasing bug])
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
-#error compiler not affected by placement new aliasing bug
-#endif
-])],
- [AC_MSG_RESULT([yes]); aliasing_flags='-fno-strict-aliasing'],
- [AC_MSG_RESULT([no])])
-
- CXXFLAGS="$saved_CXXFLAGS"
-fi
-AC_SUBST(aliasing_flags)
-
-
-
# ---------------------
# Warnings and checking
# ---------------------
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index cb4ff09..8e9b8ea 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,28 @@
+2025-08-06 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/121231
+ PR c++/119688
+ PR c++/94511
+ * mangle.cc (write_expression): Write out implicit non-trailing
+ zeroes of a CONSTRUCTOR when the ABI version is at least 21.
+
+2025-08-06 Jason Merrill <jason@redhat.com>
+
+ * constexpr.cc (cxx_eval_indirect_ref): Improve diagnostic.
+
+2025-08-06 Kwok Cheung Yeung <kcyeung@baylibre.com>
+
+ * parser.cc (cp_parser_omp_clause_from_to): Parse 'iterator' modifier.
+ * semantics.cc (finish_omp_clauses): Finish iterators for to/from
+ clauses.
+
+2025-08-06 Kwok Cheung Yeung <kcyeung@baylibre.com>
+ Andrew Stubbs <ams@baylibre.com>
+
+ * parser.cc (cp_parser_omp_clause_map): Parse 'iterator' modifier.
+ * semantics.cc (finish_omp_clauses): Finish iterators. Apply
+ iterators to generated clauses.
+
2025-08-05 Jason Merrill <jason@redhat.com>
PR c++/121068
diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog
index 4fe6418..1217b5d 100644
--- a/gcc/d/ChangeLog
+++ b/gcc/d/ChangeLog
@@ -1,3 +1,7 @@
+2025-08-06 Sam James <sam@gentoo.org>
+
+ * Make-lang.in (ALL_DFLAGS): Don't use ALIASING_FLAGS.
+
2025-07-25 David Malcolm <dmalcolm@redhat.com>
* d-diagnostic.cc: Likewise.
diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
index 2d444c9..0ddd524 100644
--- a/gcc/d/Make-lang.in
+++ b/gcc/d/Make-lang.in
@@ -61,7 +61,7 @@ WARN_DFLAGS = -Wall -Wdeprecated
NOEXCEPTION_DFLAGS = $(filter-out -fno-rtti, $(NOEXCEPTION_FLAGS))
ALL_DFLAGS = $(DFLAGS-$@) $(GDCFLAGS) -fversion=IN_GCC $(CHECKING_DFLAGS) \
- $(PICFLAG) $(ALIASING_FLAGS) $(NOEXCEPTION_DFLAGS) $(COVERAGE_FLAGS) \
+ $(PICFLAG) $(NOEXCEPTION_DFLAGS) $(COVERAGE_FLAGS) \
$(WARN_DFLAGS)
DCOMPILE.base = $(GDC) -c $(ALL_DFLAGS) -o $@
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 64c1217..7423224 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -393,7 +393,7 @@ Note binutils 2.35 or newer is required for LTO to work correctly
with GNU libtool that includes doing a bootstrap with LTO enabled.
@item gzip version 1.2.4 (or later) or
-@itemx bzip2 version 1.0.2 (or later)
+@itemx xz version 5.0 (or later)
Necessary to uncompress GCC @command{tar} files when source code is
obtained via HTTPS mirror sites.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1ac6084..df2c843 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,112 @@
+2025-08-06 Sam James <sam@gentoo.org>
+
+ * g++.dg/cpp26/constexpr-new3.C: Escape '[' and ']'.
+
+2025-08-06 Alexandre Oliva <oliva@adacore.com>
+
+ * gcc.dg/torture/hardbool-ai.c: New.
+ * gcc.dg/torture/hardbool-vi.c: New.
+ * gcc.dg/torture/hardbool.c: Handle NO_BITFIELDS.
+ (add1, preinc, postinc, sub1, predec, postdec): New.
+ (main): Exercise them.
+
+2025-08-06 Martin Uecker <uecker@tugraz.at>
+
+ PR c/108931
+ * gcc.dg/vla-tert-1.c: New test.
+
+2025-08-06 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/121231
+ PR c++/119688
+ PR c++/94511
+ * g++.dg/abi/mangle82.C: New test.
+ * g++.dg/cpp2a/nontype-class73.C: New test.
+
+2025-08-06 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp26/constexpr-new3.C: Tweak diagnostic.
+
+2025-08-06 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/vect/vect-gather-1.c: Adjust to hide N.
+
+2025-08-06 Tejas Belagod <tejas.belagod@arm.com>
+
+ * gcc.target/aarch64/sve/acle/general/cops.c: Fix test.
+
+2025-08-06 Yang Yujie <yangyujie@loongson.cn>
+
+ * gcc.dg/torture/bitint-84.c: New test.
+
+2025-08-06 Yang Yujie <yangyujie@loongson.cn>
+
+ * gcc.dg/torture/bitint-83.c: New test.
+
+2025-08-06 Yang Yujie <yangyujie@loongson.cn>
+
+ * gcc.dg/bitintext.h (BEXTC1): Define. Convert the copied
+ object back to the original type before comparison.
+ (BEXTC): Use BEXTC1 for both the signed and the unsigned case.
+
+2025-08-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/121413
+ * gcc.dg/torture/bitint-85.c: New test.
+
+2025-08-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/121127
+ * gcc.dg/bitint-125.c: New test.
+
+2025-08-06 Yuao Ma <c8ef@outlook.com>
+
+ * gfortran.dg/c_f_pointer_shape_tests_2.f03: Use the new driver.
+ * gfortran.dg/c_f_pointer_shape_tests_4.f03: Ditto.
+ * gfortran.dg/c_f_pointer_shape_tests_4_driver.c: Removed.
+ * gfortran.dg/c_f_pointer_shape_tests_2_driver.c: Renamed to ...
+ * gfortran.dg/c_f_pointer_shape_tests_driver.c: ... this; format
+ with gcc style.
+
+2025-08-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/120778
+ * c-c++-common/cpp/comment-ff-1.c: New test.
+ * c-c++-common/cpp/comment-vtab-1.c: New test.
+
+2025-08-06 Martin Uecker <uecker@tugraz.at>
+
+ PR c/121217
+ * gcc.dg/pr121217.c: New test.
+
+2025-08-06 Kito Cheng <kito.cheng@sifive.com>
+
+ * gcc.target/riscv/arch-unset-1.c: New test.
+ * gcc.target/riscv/arch-unset-2.c: New test.
+ * gcc.target/riscv/arch-unset-3.c: New test.
+ * gcc.target/riscv/arch-unset-4.c: New test.
+ * gcc.target/riscv/arch-unset-5.c: New test.
+
+2025-08-06 Kwok Cheung Yeung <kcyeung@baylibre.com>
+
+ * c-c++-common/gomp/target-update-iterators-1.c: New.
+ * c-c++-common/gomp/target-update-iterators-2.c: New.
+ * c-c++-common/gomp/target-update-iterators-3.c: New.
+
+2025-08-06 Kwok Cheung Yeung <kcyeung@baylibre.com>
+ Andrew Stubbs <ams@baylibre.com>
+
+ * c-c++-common/gomp/map-6.c (foo): Amend expected error message.
+ * c-c++-common/gomp/target-map-iterators-1.c: New.
+ * c-c++-common/gomp/target-map-iterators-2.c: New.
+ * c-c++-common/gomp/target-map-iterators-3.c: New.
+ * c-c++-common/gomp/target-map-iterators-4.c: New.
+
+2025-08-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/121234
+ * gfortran.dg/pr121234.f90: New test.
+
2025-08-05 Jason Merrill <jason@redhat.com>
PR c++/121068
diff --git a/gcc/testsuite/g++.dg/cpp26/constexpr-new3.C b/gcc/testsuite/g++.dg/cpp26/constexpr-new3.C
index 7466199..c79060f 100644
--- a/gcc/testsuite/g++.dg/cpp26/constexpr-new3.C
+++ b/gcc/testsuite/g++.dg/cpp26/constexpr-new3.C
@@ -37,7 +37,7 @@ baz ()
{
std::allocator<int> a;
auto b = a.allocate (2);
- new (b) long (42); // { dg-error "accessing value of 'int [2]' object through a 'long int' glvalue in a constant expression" }
+ new (b) long (42); // { dg-error "accessing value of 'int \\\[2\\\]' object through a 'long int' glvalue in a constant expression" }
a.deallocate (b, 2);
return true;
}
diff --git a/gcc/testsuite/gcc.dg/torture/hardbool-ai.c b/gcc/testsuite/gcc.dg/torture/hardbool-ai.c
new file mode 100644
index 0000000..97569a6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/hardbool-ai.c
@@ -0,0 +1,7 @@
+/* { dg-do run } */
+
+#define basetype _Atomic int
+
+#define NO_BITFIELDS 1
+
+#include "hardbool.c"
diff --git a/gcc/testsuite/gcc.dg/torture/hardbool-vi.c b/gcc/testsuite/gcc.dg/torture/hardbool-vi.c
new file mode 100644
index 0000000..898d395
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/hardbool-vi.c
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+
+#define basetype volatile int
+
+#include "hardbool.c"
diff --git a/gcc/testsuite/gcc.dg/torture/hardbool.c b/gcc/testsuite/gcc.dg/torture/hardbool.c
index 0168495..ed0c598 100644
--- a/gcc/testsuite/gcc.dg/torture/hardbool.c
+++ b/gcc/testsuite/gcc.dg/torture/hardbool.c
@@ -21,8 +21,12 @@ typedef unsigned char __attribute__ ((__hardbool__ (1, 0))) zbool;
struct hs {
hbool a[2];
+#ifndef NO_BITFIELDS
hbool x:2;
hbool y:5;
+#else
+ hbool x, y;
+#endif
zbool z:1;
};
@@ -57,6 +61,30 @@ int ghs(hbool s) {
int t = (hbool)2;
+hbool add1(hbool *s) {
+ return *s += 1;
+}
+
+hbool preinc(hbool *s) {
+ return ++*s;
+}
+
+hbool postinc(hbool *s) {
+ return (*s)++;
+}
+
+hbool sub1(hbool *s) {
+ return *s -= 1;
+}
+
+hbool predec(hbool *s) {
+ return --*s;
+}
+
+hbool postdec(hbool *s) {
+ return (*s)--;
+}
+
void check_pfalse (hbool *p)
{
assert (!*p);
@@ -114,5 +142,43 @@ int main () {
check_vtrue (h2 (2));
check_vtrue (h2 (1));
check_vfalse (h2 (0));
-}
+ hbool v;
+ v = 0;
+ check_vtrue (add1 (&v));
+ assert (v);
+ v = 0;
+ check_vtrue (preinc (&v));
+ assert (v);
+ v = 0;
+ check_vfalse (postinc (&v));
+ assert (v);
+ v = 0;
+ check_vtrue (sub1 (&v));
+ assert (v);
+ v = 0;
+ check_vtrue (predec (&v));
+ assert (v);
+ v = 0;
+ check_vfalse (postdec (&v));
+ assert (v);
+
+ v = 1;
+ check_vtrue (add1 (&v));
+ assert (v);
+ v = 1;
+ check_vtrue (preinc (&v));
+ assert (v);
+ v = 1;
+ check_vtrue (postinc (&v));
+ assert (v);
+ v = 1;
+ check_vfalse (sub1 (&v));
+ assert (!v);
+ v = 1;
+ check_vfalse (predec (&v));
+ assert (!v);
+ v = 1;
+ check_vtrue (postdec (&v));
+ assert (!v);
+}
diff --git a/gcc/testsuite/gcc.dg/vla-tert-1.c b/gcc/testsuite/gcc.dg/vla-tert-1.c
new file mode 100644
index 0000000..dfbb2e6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vla-tert-1.c
@@ -0,0 +1,293 @@
+/* { dg-do run }
+ * { dg-options "-std=c99" }
+ * */
+
+
+// For the conditional operator and variably modified types,
+// verify that the size expression on the selected branch
+// is evaluated and the correct result is returned.
+
+
+// keep track which side was evaluated.
+static int fc[2] = { 0 };
+
+static int f(int s, int c)
+{
+ fc[c]++;
+ return s;
+}
+
+
+int main()
+{
+ // two VLAs, constant condition
+
+ fc[0] = fc[1] = 0;
+
+ if (5 != sizeof(*(1 ? (char(*)[ f(5, 0) ])0 : (char(*)[ f(3, 1) ])0)))
+ __builtin_abort();
+
+ if ((1 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ fc[0] = fc[1] = 0;
+
+ if (3 != sizeof(*(0 ? (char(*)[ f(5, 0) ])0 : (char(*)[ f(3, 1) ])0)))
+ __builtin_abort(); // fails
+
+ if ((0 != fc[0]) || (1 != fc[1]))
+ __builtin_abort(); // fails
+
+ // two VLAs
+
+ int c = 0;
+ fc[0] = fc[1] = 0;
+
+ if (3 != sizeof(*(c ? (char(*)[ f(5, 0) ])0 : (char(*)[ f(3, 1) ])0)))
+ __builtin_abort(); // fails
+
+ if ((0 != fc[0]) || (1 != fc[1]))
+ __builtin_abort();
+
+ c = 1;
+ fc[0] = fc[1] = 0;
+
+ if (5 != sizeof(*(c ? (char(*)[ f(5, 0) ])0 : (char(*)[ f(3, 1) ])0)))
+ __builtin_abort();
+
+ if ((1 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ // VLA + array of unknown size, VLA side is evaluated, defined
+
+ c = 0;
+ fc[0] = fc[1] = 0;
+
+ if (3 != sizeof(*(c ? (char(*)[ ])0 : (char(*)[ f(3, 1) ])0)))
+ __builtin_abort();
+
+ if ((0 != fc[0]) || (1 != fc[1]))
+ __builtin_abort();
+
+ c = 1;
+ fc[0] = fc[1] = 0;
+
+ if (5 != sizeof(*(c ? (char(*)[ f(5, 0) ])0 : (char(*)[ ])0)))
+ __builtin_abort();
+
+ if ((1 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ // VLA + array of unknown size, VLA side is not evaluated
+
+ c = 1;
+ fc[0] = fc[1] = 0;
+
+ sizeof(*(c ? (char(*)[ ])0 : (char(*)[ f(3, 1) ])0));
+
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ // without sizeof
+
+ fc[0] = fc[1] = 0;
+
+ (c ? (char(*)[ ])0 : (char(*)[ f(3, 1) ])0);
+
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ c = 0;
+ fc[0] = fc[1] = 0;
+
+ sizeof(*(c ? (char(*)[ f(5, 0) ])0 : (char(*)[ ])0));
+
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ // without sizeof
+
+ fc[0] = fc[1] = 0;
+
+ (c ? (char(*)[ f(5, 0) ])0 : (char(*)[ ])0);
+
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+
+ // VLA + array of known size, VLA side is evaluated
+
+ c = 0;
+ fc[0] = fc[1] = 0;
+
+ if (3 != sizeof(*(c ? (char(*)[3])0 : (char(*)[ f(3, 1) ])0)))
+ __builtin_abort();
+
+ // sizeof is not evaluated because not a VLA
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ c = 0;
+ fc[0] = fc[1] = 0;
+
+ // without sizeof
+
+ (c ? (char(*)[3])0 : (char(*)[ f(3, 1) ])0);
+
+ if ((0 != fc[0]) || (1 != fc[1]))
+ __builtin_abort();
+
+ c = 1;
+ fc[0] = fc[1] = 0;
+
+ if (5 != sizeof(*(c ? (char(*)[ f(5, 0) ])0 : (char(*)[5])0)))
+ __builtin_abort();
+
+ // sizeof is not evaluated because not a VLA
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ // without sizeof
+
+ fc[0] = fc[1] = 0;
+
+ (c ? (char(*)[ f(5, 0) ])0 : (char(*)[ 5 ])0);
+
+ if ((1 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ // VLA + array of known size, VLA side is not evaluated
+
+ c = 0;
+ fc[0] = fc[1] = 0;
+
+ if (3 != sizeof(*(c ? (char(*)[ f(3, 0) ])0 : (char(*)[ 3 ])0)))
+ __builtin_abort();
+
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ c = 1;
+ fc[0] = fc[1] = 0;
+
+ if (5 != sizeof(*(c ? (char(*)[ 5 ])0 : (char(*)[ f(5, 1) ])0)))
+ __builtin_abort();
+
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ // VM type on one side, null pointer on the other side
+
+ c = 0;
+ fc[0] = fc[1] = 0;
+
+ if (3 != sizeof(*(c ? (void*)0 : (char(*)[ f(3, 1) ])0)))
+ __builtin_abort();
+
+ if ((0 != fc[0]) || (1 != fc[1]))
+ __builtin_abort();
+
+ c = 1;
+ fc[0] = fc[1] = 0;
+
+ if (5 != sizeof(*(c ? (char(*)[ f(5, 0) ])0 : (void*)0)))
+ __builtin_abort();
+
+ if ((1 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+#if 0
+ // these cases are not fixable
+ // VM types on one side, null pointer on the other side
+ c = 1;
+ fc[0] = fc[1] = 0;
+
+ if (3 != sizeof(*(c ? (void*)0 : (char(*)[ f(3, 1) ])0)))
+ __builtin_abort();
+
+ if ((0 != fc[0]) || (1 != fc[1]))
+ __builtin_abort();
+
+ c = 0;
+ fc[0] = fc[1] = 0;
+
+ if (5 != sizeof(*(c ? (char(*)[ f(5, 0) ])0 : (void*)0)))
+ __builtin_abort();
+
+ if ((1 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+#endif
+
+ // VLA + void*
+ void* p = 0;
+ c = 0;
+ fc[0] = fc[1] = 0;
+
+ if (1 != sizeof(*(c ? p : (char(*)[ f(3, 1) ])0)))
+ __builtin_abort();
+
+ // not a VLA or evaluated
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ // .. without sizeof
+
+ (c ? p : (char(*)[ f(3, 1) ])0);
+
+ if ((0 != fc[0]) || (1 != fc[1]))
+ __builtin_abort();
+
+ c = 1;
+ fc[0] = fc[1] = 0;
+
+ if (1 != sizeof(*(c ? (char(*)[ f(5, 0) ])0 : p)))
+ __builtin_abort();
+
+ // not a VLA
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ // .. without sizeof
+
+ (c ? (char(*)[ f(5, 0) ])0 : p);
+
+ if ((1 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ // VLA + void*, VLA side not evaluated
+
+ c = 1;
+ fc[0] = fc[1] = 0;
+
+ if (1 != sizeof(*(c ? p : (char(*)[ f(3, 1) ])0)))
+ __builtin_abort();
+
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ // .. without sizeof
+
+ (c ? p : (char(*)[ f(3, 1) ])0);
+
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ c = 0;
+ fc[0] = fc[1] = 0;
+
+ if (1 != sizeof(*(c ? (char(*)[ f(5, 0) ])0 : p)))
+ __builtin_abort();
+
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ // .. without sizeof
+
+ (c ? (char(*)[ f(5, 0) ])0 : p);
+
+ if ((0 != fc[0]) || (0 != fc[1]))
+ __builtin_abort();
+
+ return 0;
+}
+