when simplifying subregs of constants.
* g++.dg/opt/reload1.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58490
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-10-24 Richard Henderson <rth@redhat.com>
+
+ PR opt/7944
+ * reload.c (find_reloads_toplev): Mode of X is not important
+ when simplifying subregs of constants.
+
2002-10-24 Richard Sandiford <rsandifo@redhat.com>
* config.gcc (mips64vr-*-elf*, mips64vrel-*-elf*): Add
reg_equiv_constant[regno])) != 0)
return tem;
- if (GET_MODE_BITSIZE (GET_MODE (x)) == BITS_PER_WORD
- && regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] < 0
+ if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] < 0
&& reg_equiv_constant[regno] != 0)
{
tem =
--- /dev/null
+// PR 7944
+// { dg-do compile }
+// { dg-options -O2 }
+
+struct B
+{
+ B & operator << (short s)
+ {
+ int j;
+ if (j)
+ return operator << (s);
+ else
+ return operator << (s);
+ }
+};
+
+struct A
+{
+ int i;
+ static void bar ();
+ static int quux ()
+ {
+ bar ();
+ return 0;
+ }
+
+ A ():i (quux ())
+ {
+ }
+ ~A ()
+ {
+ }
+};
+
+void
+foo ()
+{
+ short s[4] = { 0, 0, 0, 1 };
+ A a[2] = { A (), A () };
+
+ B b;
+ b << s[0] << s[2];
+}