Bug 29204 - [4.1/4.2 Regression] duplicates existing symbol from inline assembler at -O
Summary: [4.1/4.2 Regression] duplicates existing symbol from inline assembler at -O
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-24 16:48 UTC by Martin Michlmayr
Modified: 2006-09-24 17:01 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2006-09-24 16:48:25 UTC
(sid)129:tbm@chico: ~/delta/bin] gcc-3.4 -c -O3 mini.c
(sid)130:tbm@chico: ~/delta/bin] gcc-4.0 -c -O3 mini.c
(sid)131:tbm@chico: ~/delta/bin] gcc-4.1 -c -O3 mini.c
/tmp/cciWV4B7.s: Assembler messages:
/tmp/cciWV4B7.s:25: Error: symbol `L26' is already defined
/tmp/cciWV4B7.s:26: Error: symbol `L24' is already defined
zsh: exit 1     gcc-4.1 -c -O3 mini.c
(sid)132:tbm@chico: ~/delta/bin] /usr/lib/gcc-snapshot/bin/gcc -c -O3 mini.c
/tmp/ccPxQMaA.s: Assembler messages:
/tmp/ccPxQMaA.s:25: Error: symbol `L26' is already defined
/tmp/ccPxQMaA.s:26: Error: symbol `L24' is already defined
zsh: exit 1     /usr/lib/gcc-snapshot/bin/gcc -c -O3 mini.c
(sid)133:tbm@chico: ~/delta/bin]
(sid)133:tbm@chico: ~/delta/bin] gcc-4.1 -c mini.c
(sid)134:tbm@chico: ~/delta/bin] /usr/lib/gcc-snapshot/bin/gcc -c mini.c
(sid)135:tbm@chico: ~/delta/bin] cat mini.c
extern unsigned long *p;
movinvr ()
{
  int i;
  unsigned long *pe;
  unsigned long num;
  for (i = 0; i < 2; i++)
    {
      asm __volatile__ ("jmp L26\n\t" ".p2align 4,,7\n\t" "L26:\n\t"
                        "L24:\n\t":"=D" (p):"D" (p), "S" (pe),
                        "b" (num):"eax", "ecx", "edx");
    }
}
Comment 1 Andrew Pinski 2006-09-24 17:01:04 UTC
This is not a bug as asms can be duplicated even if they are volatile.
The way to fix this is to use .1 and 1f lables.