2020-04-23 Jakub Jelinek <jakub@redhat.com>
+ PR target/94707
+ * config/rs6000/rs6000-call.c (rs6000_aggregate_candidate): Add
+ cxx17_empty_base_seen argument. Pass it to recursive calls.
+ Ignore cxx17_empty_base_field_p fields after setting
+ *cxx17_empty_base_seen to true.
+ (rs6000_discover_homogeneous_aggregate): Adjust
+ rs6000_aggregate_candidate caller. With -Wpsabi, diagnose homogeneous
+ aggregates with C++17 empty base fields.
+
+ PR c/94705
+ * attribs.c (decl_attribute): Don't diagnose attribute exclusions
+ if last_decl is error_mark_node or has such a TREE_TYPE.
+
PR c/94705
* attribs.c (decl_attribute): Don't diagnose attribute exclusions
if last_decl is error_mark_node or has such a TREE_TYPE.
sub-tree. */
static int
-rs6000_aggregate_candidate (const_tree type, machine_mode *modep)
+rs6000_aggregate_candidate (const_tree type, machine_mode *modep,
+ bool *cxx17_empty_base_seen)
{
machine_mode mode;
HOST_WIDE_INT size;
|| TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
return -1;
- count = rs6000_aggregate_candidate (TREE_TYPE (type), modep);
+ count = rs6000_aggregate_candidate (TREE_TYPE (type), modep,
+ cxx17_empty_base_seen);
if (count == -1
|| !index
|| !TYPE_MAX_VALUE (index)
if (TREE_CODE (field) != FIELD_DECL)
continue;
- sub_count = rs6000_aggregate_candidate (TREE_TYPE (field), modep);
+ if (cxx17_empty_base_field_p (field))
+ {
+ *cxx17_empty_base_seen = true;
+ continue;
+ }
+
+ sub_count = rs6000_aggregate_candidate (TREE_TYPE (field), modep,
+ cxx17_empty_base_seen);
if (sub_count < 0)
return -1;
count += sub_count;
if (TREE_CODE (field) != FIELD_DECL)
continue;
- sub_count = rs6000_aggregate_candidate (TREE_TYPE (field), modep);
+ sub_count = rs6000_aggregate_candidate (TREE_TYPE (field), modep,
+ cxx17_empty_base_seen);
if (sub_count < 0)
return -1;
count = count > sub_count ? count : sub_count;
&& AGGREGATE_TYPE_P (type))
{
machine_mode field_mode = VOIDmode;
- int field_count = rs6000_aggregate_candidate (type, &field_mode);
+ bool cxx17_empty_base_seen = false;
+ int field_count = rs6000_aggregate_candidate (type, &field_mode,
+ &cxx17_empty_base_seen);
if (field_count > 0)
{
*elt_mode = field_mode;
if (n_elts)
*n_elts = field_count;
+ if (cxx17_empty_base_seen && warn_psabi)
+ {
+ static const_tree last_reported_type;
+ if (type != last_reported_type)
+ {
+ inform (input_location,
+ "parameter passing for argument of type %qT "
+ "when C++17 is enabled changed to match C++14 "
+ "in GCC 10.1", type);
+ last_reported_type = type;
+ }
+ }
return true;
}
}