This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/80108] ICE in aggregate_value_p at function.c:2028


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80108

--- Comment #9 from kelvin at gcc dot gnu.org ---
I've got a patch now that resolves this problem without creating regressions. 
I'm attaching it for "discussion" here before I post for "official review".

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c  (revision 246573)
+++ gcc/config/rs6000/rs6000.c  (working copy)
@@ -4273,8 +4273,30 @@ rs6000_option_override_internal (bool global_init_
   /* For the newer switches (vsx, dfp, etc.) set some of the older options,
      unless the user explicitly used the -mno-<option> to disable the code. 
*/
   if (TARGET_P9_VECTOR || TARGET_MODULO || TARGET_P9_DFORM_SCALAR
-      || TARGET_P9_DFORM_VECTOR || TARGET_P9_DFORM_BOTH > 0 ||
TARGET_P9_MINMAX)
+      || TARGET_P9_DFORM_VECTOR || TARGET_P9_DFORM_BOTH > 0)
     rs6000_isa_flags |= (ISA_3_0_MASKS_SERVER & ~rs6000_isa_flags_explicit);
+  else if (TARGET_P9_MINMAX)
+    {
+      if (have_cpu)
+       {
+         if (cpu_index == PROCESSOR_POWER9)
+           /* legacy behavior: allow -mcpu-power9 with certain capabilities
+              (eg -mno-vsx) explicitly disabled.  */
+           rs6000_isa_flags |=
+             (ISA_3_0_MASKS_SERVER & ~rs6000_isa_flags_explicit);
+         else
+           error ("Power9 target option is incompatible with -mcpu=<xxx> for "
+                  "<xxx> less than power9");
+       }
+      else if ((ISA_3_0_MASKS_SERVER & rs6000_isa_flags_explicit)
+              != (ISA_3_0_MASKS_SERVER & rs6000_isa_flags
+                  & rs6000_isa_flags_explicit))
+       /* Enforce that none of the ISA_3_0_MASKS_SERVER flags
+          were explicitly cleared.  */
+       error ("-mpower9-minmax incompatible with explicitly disabled
options");
+      else
+       rs6000_isa_flags |= ISA_3_0_MASKS_SERVER;
+    }
   else if (TARGET_P8_VECTOR || TARGET_DIRECT_MOVE || TARGET_CRYPTO)
     rs6000_isa_flags |= (ISA_2_7_MASKS_SERVER & ~rs6000_isa_flags_explicit);
   else if (TARGET_VSX)

I'm seeking feedback on whether this is the treatment you are all comfortable
with.

Note that the way I handle TARGET_P9_MINMAX is very different than the way we
handle other p9-specific target options (see the first line replaced by this
patch).  An earlier draft of my patch handled all six of these options the same
way that my patch handles TARGET_P9_MINMAX, but that resulted in 942 fewer
"expected passes", 4 more "unexpected failures", and 309 more "unsupported
tests" in the gcc summary.  It is these inconsistencies that make me a little
uncomfortable with how this solution is structured.

I welcome feedback and suggestions for further refinement.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]