[Bug c/21958] New: verify_stmts reports tree node sharing assertion

2005-06-08 Thread nick at sqrt dot co dot uk
Using GCC 4.1 mainline checkout at 20050607.

$ ./i686-linux/gcc/xgcc -B ./i686-linux/gcc -S bug1.c -O1
bug1.c: In function ‘foo’:
bug1.c:2: error: Incorrect sharing of tree nodes
D.1290_47 = (charD.1 * *) pD.1236_3;

(charD.1 * *) pD.1236_3;

bug1.c:2: internal compiler error: verify_stmts failed.
Please submit a full bug report,


I've narrowed down a testcase to:

void foo (char *p)
{
  char *endptr = p;
  while (1)
{
  int i = 1;
  char **members;

  if (p[1])
{
  do {
if (*p == ',')
  {
i++;
*p = 0;
  }
  } while (*++p);
}

  members = (char **) p;
  if (--i)
{
  p = endptr;
  do {
*members++ = ++p;
if (!--i)
  break;
while (*++p) {}
  } while (1);
}
  *members = 0;
}
}

-- 
   Summary: verify_stmts reports tree node sharing assertion
   Product: gcc
   Version: 4.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: nick at sqrt dot co dot uk
CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


[Bug ada/20797] New: Code gen creating out-of-bounds addresses on legit code

2005-04-06 Thread nick at sqrt dot co dot uk
Looking at GCC 4.0 20050318, and configuring as a cross-compiler for ARM/Linux
thusly:
 
$ mkdir arm-linux ; cd arm-linux
$ ../configure --prefix=/opt/gcc-linux --target=arm-linux-elf
--enable-languages=c,ada

Once the gnat1 binary is built, just type this from the gcc/ada directory.

$ ../../arm-linux/gcc/gnat1 nlists.adb -O2 -o nlists.s -gnatpg

Turning off optimisation makes no difference to the resulting problem.


The compiled version of Nlists::First() results in:

nlists__first:
@ args = 0, pretend = 0, frame = 0, outgoing = 0
@ frame_needed = 0, uses_anonymous_args = 0
@ link register save eliminated.
cmp r0, #0
ldrne   r2, .L320
mov r1, #1191182336
ldrne   r3, [r2, #0]
add ip, r0, r0, asl #1
add r1, r1, #8781824
add r1, r1, #35840
addne   r3, r3, ip, asl #2
ldrne   r0, [r3, r1]
@ lr needed for prologue
bx  lr
.L320:
.word   nlists__lists__tableX

The problem I see is an out-of-bounds memory access here:
ldrne   r0, [r3, r1]

FYI, on my machine:
   R1 == 0x47868c00
   R3 == 0xb97d3a9c

Here, R3 points to a legitimate memory address
Surely R1 is a little large ?

-- 
   Summary: Code gen creating out-of-bounds addresses on legit code
   Product: gcc
   Version: 4.0.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: nick at sqrt dot co dot uk
CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: arm-linux-elf


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


[Bug ada/17701] Can't crosscompile ada to armv5tel

2005-03-06 Thread nick at sqrt dot co dot uk

--- Additional Comments From nick at sqrt dot co dot uk  2005-03-06 15:51 
---
This is a longstanding bug that still occurs for the 4.0 branch.

For ARM change:

 Integer'Min (2, Standard'Maximum_Alignment);

to:

 Integer'Min (4, Standard'Maximum_Alignment);


-- 


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