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 tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50802

Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amylaar at gcc dot gnu.org

--- Comment #13 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 2011-11-18 20:20:22 UTC ---
(In reply to comment #1)

> The r2 value is wrong.

I see the same problem on Epiphany.
The result of the modulo operation for short int is recycled for signed char.
arith-rand-ll.c.079t.copyrename3 looks OK, but in arith-rand-ll.c.080t.dom1
I see that ill-advised recycling of the modulo result, D.2263_64 in the
below dump snippets:

<bb 27>:
  xx_56 = (short int) x_5;
  # DEBUG xx => xx_56
  yy_57 = (short int) y_6;
  # DEBUG yy => yy_57
  D.2260_58 = (int) x_5;
  D.2261_59 = (int) y_6;
  D.2262_60 = D.2260_58 / D.2261_59;
  # DEBUG r1 => (short int) D.2262_60
  D.2263_64 = D.2260_58 % D.2261_59;
  r2_65 = (short int) D.2263_64;
  # DEBUG r2 => r2_65
  D.2266_66 = (int) r2_65;
  D.2267_67 = ABS_EXPR <D.2266_66>;
  if (yy_57 >= 0)
    goto <bb 28>;
  else
    goto <bb 29>;
...
<bb 31>:
  r1.4_73 = (short unsigned int) D.2262_60;
  yy.3_74 = (short unsigned int) y_6;
  D.2276_75 = r1.4_73 * yy.3_74;
  r2.5_76 = (short unsigned int) D.2263_64;
  D.2278_77 = D.2276_75 + r2.5_76;
  D.2279_78 = (short int) D.2278_77;
  if (D.2279_78 != xx_56)
    goto <bb 32>;
  else
    goto <bb 33>;
...
<bb 37>:
  xx_89 = (signed char) x_5;
  # DEBUG xx => xx_89
  yy_90 = (signed char) y_6;
  # DEBUG yy => yy_90
  D.2291_91 = D.2260_58;
  D.2292_92 = D.2261_59;
  D.2293_93 = D.2262_60;
  # DEBUG r1 => (signed char) D.2262_60
  D.2294_97 = D.2263_64;
  r2_98 = (signed char) D.2263_64;
  # DEBUG r2 => r2_98
  D.2297_99 = (int) r2_98;
  D.2298_100 = ABS_EXPR <D.2297_99>;
  if (yy_90 >= 0)
    goto <bb 38>;
  else
    goto <bb 39>;
...
<bb 41>:
  r1.8_106 = (unsigned char) D.2262_60;
  yy.7_107 = (unsigned char) y_6;
  D.2307_108 = r1.8_106 * yy.7_107;
  r2.9_109 = (unsigned char) D.2263_64;
  D.2309_110 = D.2307_108 + r2.9_109;
  D.2310_111 = (signed char) D.2309_110;
  if (D.2310_111 != xx_89)
    goto <bb 42>;
  else
    goto <bb 43>;


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