[Bug rtl-optimization/38644] [4.6 Regression] Optimization flag -O1 -fschedule-insns2 causes wrong code

2016-03-14 Thread satishbmsce at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38644

Satish M  changed:

   What|Removed |Added

 CC||satishbmsce at gmail dot com

--- Comment #72 from Satish M  ---
This bug still exists in GCC 4.8.2 ARM. It can reproduced by adding one more
argument in 'doStreamReadBlock' function in test case.

/x86_64-unknown-linux-gnu/bin/gcc -B /x86_64-unknown-linux-gnu/bin -msoft-float
-marm -mcpu=cortex-a9 -march=armv7-a -mno-thumb-interwork -mlong-calls
-mno-unaligned-access -O2 test.c

extern int doStreamReadBlock (int *, char *, int size, int, int);

char readStream (int *s)
{
   char c = 0;
   doStreamReadBlock (s, &c, 1, *s, 22);
   return c;
}

 :
   0:   e1a0c00dmov ip, sp
   4:   e3a02000mov r2, #0
   8:   e92dd800push{fp, ip, lr, pc}
   c:   e24cb004sub fp, ip, #4
  10:   e24dd008sub sp, sp, #8
  14:   e24b100csub r1, fp, #12
  18:   e3a0c016mov ip, #22
  1c:   e5612001strbr2, [r1, #-1]!
  20:   e3a02001mov r2, #1
  24:   e5903000ldr r3, [r0]
  28:   e58dc000str ip, [sp]
  2c:   e59fc00cldr ip, [pc, #12]   ; 40 
  30:   e12fff3cblx ip
  34:   e24bd00csub sp, fp, #12< Stack frame
de-allocated
  38:   e55b000dldrbr0, [fp, #-13] < Accessing stack.
  3c:   e89da800ldm sp, {fp, sp, pc}
  40:   andeq   r0, r0, r0

[Bug c/70223] New: [ARM] Optimization level -O2 results in wrong code

2016-03-14 Thread satishbmsce at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70223

Bug ID: 70223
   Summary: [ARM] Optimization level -O2 results in wrong code
   Product: gcc
   Version: 4.8.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: satishbmsce at gmail dot com
  Target Milestone: ---

-fschedule-insns2 flag within optimization level -O2 results in wrong code. By
adding one more argument to test function 'doStreamReadBlock' defined in file
'gcc/testsuite/gcc.target/arm/stack-red-zone.c' issue can produced. 

/x86_64-unknown-linux-gnu/bin/gcc -B /x86_64-unknown-linux-gnu/bin -msoft-float
-marm -mcpu=cortex-a9 -march=armv7-a -mno-thumb-interwork -mlong-calls
-mno-unaligned-access -O2 test.c

test.c: 
extern int doStreamReadBlock (int *, char *, int size, int, int);

char readStream (int *s)
{
   char c = 0;
   doStreamReadBlock (s, &c, 1, *s, 22);
   return c;
}

 :
   0:   e1a0c00dmov ip, sp
   4:   e3a02000mov r2, #0
   8:   e92dd800push{fp, ip, lr, pc}
   c:   e24cb004sub fp, ip, #4
  10:   e24dd008sub sp, sp, #8
  14:   e24b100csub r1, fp, #12
  18:   e3a0c016mov ip, #22
  1c:   e5612001strbr2, [r1, #-1]!
  20:   e3a02001mov r2, #1
  24:   e5903000ldr r3, [r0]
  28:   e58dc000str ip, [sp]
  2c:   e59fc00cldr ip, [pc, #12]   ; 40 
  30:   e12fff3cblx ip
  34:   e24bd00csub sp, fp, #12< Stack frame
de-allocated
  38:   e55b000dldrbr0, [fp, #-13] < Accessing stack.
  3c:   e89da800ldm sp, {fp, sp, pc}
  40:   andeq   r0, r0, r0