diff mbox series

[RS6000] Don't rely on rs6000_hard_regno_mode_ok being zero

Message ID 20190326051005.GA13871@bubble.grove.modra.org
State New
Headers show
Series [RS6000] Don't rely on rs6000_hard_regno_mode_ok being zero | expand

Commit Message

Alan Modra March 26, 2019, 5:10 a.m. UTC
rs6000_hard_regno_mode_ok_uncached result depends on target flags,
and nowadays it is possible that TARGET_OPTION_OVERRIDE be called not
just at the start of compilation but per-function by the action of
function attributes or "#pragma GCC target".  At the start of
compilation rs6000_hard_regno_mode_ok_p[][] is a clean slate, but
not so later on.

Bootstrapped etc. powerpc64le-linux.  If gcc wasn't in stage 4 I'd
apply this as obvious, but I doubt it is a regression, and the patch
is just a tiny bit more than a doc fix.  So, OK now or wait for
stage 1?

	* config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Always
	assign rs6000_hard_regno_mode_ok_p[m][r].  Formatting.

Comments

Segher Boessenkool March 26, 2019, 6:02 p.m. UTC | #1
On Tue, Mar 26, 2019 at 03:40:05PM +1030, Alan Modra wrote:
> rs6000_hard_regno_mode_ok_uncached result depends on target flags,
> and nowadays it is possible that TARGET_OPTION_OVERRIDE be called not
> just at the start of compilation but per-function by the action of
> function attributes or "#pragma GCC target".  At the start of
> compilation rs6000_hard_regno_mode_ok_p[][] is a clean slate, but
> not so later on.
> 
> Bootstrapped etc. powerpc64le-linux.  If gcc wasn't in stage 4 I'd
> apply this as obvious, but I doubt it is a regression, and the patch
> is just a tiny bit more than a doc fix.  So, OK now or wait for
> stage 1?

Now please.  Thanks!


Segher


> 	* config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Always
> 	assign rs6000_hard_regno_mode_ok_p[m][r].  Formatting.
diff mbox series

Patch

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 06ce2892bf9..f132c3a27c8 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -3463,13 +3463,13 @@  rs6000_init_hard_regno_mode_ok (bool global_init_p)
   for (r = 0; HARD_REGISTER_NUM_P (r); ++r)
     for (m = 0; m < NUM_MACHINE_MODES; ++m)
       rs6000_hard_regno_nregs[m][r]
-	= rs6000_hard_regno_nregs_internal (r, (machine_mode)m);
+	= rs6000_hard_regno_nregs_internal (r, (machine_mode) m);
 
   /* Precalculate TARGET_HARD_REGNO_MODE_OK.  */
   for (r = 0; HARD_REGISTER_NUM_P (r); ++r)
     for (m = 0; m < NUM_MACHINE_MODES; ++m)
-      if (rs6000_hard_regno_mode_ok_uncached (r, (machine_mode)m))
-	rs6000_hard_regno_mode_ok_p[m][r] = true;
+      rs6000_hard_regno_mode_ok_p[m][r]
+	= rs6000_hard_regno_mode_ok_uncached (r, (machine_mode) m);
 
   /* Precalculate CLASS_MAX_NREGS sizes.  */
   for (c = 0; c < LIM_REG_CLASSES; ++c)