public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug inline-asm/37758]  New: Assembler failure: Error: syntax error; found `,' but expected `('
@ 2008-10-06 23:06 patrick at motec dot com dot au
  2008-10-06 23:08 ` [Bug inline-asm/37758] " patrick at motec dot com dot au
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: patrick at motec dot com dot au @ 2008-10-06 23:06 UTC (permalink / raw)
  To: gcc-bugs

powerpc-eabispe-gcc -v -save-temps -I/home/patrick/src/e7/prex
-I/home/patrick/src/e7/prex/include -I/home/patrick/src/e7/prex/usr/include
-nostdinc -fsingle-precision-constant -mabi=no-spe -gdwarf-2 -Os -ansi
-fno-strict-aliasing -Wall -Wundef -Wstrict-prototypes -Wpointer-arith
-std=gnu99 -fno-stack-protector -Wno-variadic-macros -D__ppc__ -D__e7__
-D__ARCH__=ppc -D__PLATFORM__=e7 -Uppc -Ue7 -fno-omit-frame-pointer -DDEBUG -g
-Wsign-compare -Werror-implicit-function-declaration -include tomcrypt_opts.h
-I../tfm/src/headers -I../ -Wall -W -Wshadow -Isrc/headers -O3 -funroll-loops
-fomit-frame-pointer   -c -o src/mont/fp_montgomery_reduce.o
src/mont/fp_montgomery_reduce.c
Using built-in specs.
Target: powerpc-eabispe
Configured with: /home/patrick/src/e7/toolchain/src/gcc-4.3.2/configure
--prefix=/home/patrick/src/e7/toolchain/stage2 --build=x86_64-unknown-linux-gnu
--host=x86_64-unknown-linux-gnu --target=powerpc-eabispe --enable-languages=c
--disable-nls --disable-multilib --disable-werror --without-newlib
--with-gmp=/home/patrick/src/e7/toolchain/stage2
--with-mpfr=/home/patrick/src/e7/toolchain/stage2 --disable-shared
--disable-debug --disable-libssp
Thread model: single
gcc version 4.3.2 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-I/home/patrick/src/e7/prex'
'-I/home/patrick/src/e7/prex/include' '-I/home/patrick/src/e7/prex/usr/include'
'-nostdinc' '-fsingle-precision-constant' '-mabi=no-spe' '-gdwarf-2' '-Os'
'-ansi' '-fno-strict-aliasing' '-Wundef' '-Wstrict-prototypes'
'-Wpointer-arith' '-std=gnu99' '-fno-stack-protector' '-Wno-variadic-macros'
'-D__ppc__' '-D__e7__' '-D__ARCH__=ppc' '-D__PLATFORM__=e7' '-Uppc' '-Ue7'
'-DDEBUG' '-g' '-Wsign-compare' '-Werror-implicit-function-declaration'
'-include' 'tomcrypt_opts.h' '-I../tfm/src/headers' '-I../' '-Wall' '-W'
'-Wshadow' '-Isrc/headers' '-O3' '-funroll-loops' '-fomit-frame-pointer' '-c'
'-o' 'src/mont/fp_montgomery_reduce.o'
 /home/patrick/src/e7/toolchain/stage2/libexec/gcc/powerpc-eabispe/4.3.2/cc1 -E
-quiet -nostdinc -v -I/home/patrick/src/e7/prex
-I/home/patrick/src/e7/prex/include -I/home/patrick/src/e7/prex/usr/include
-I../tfm/src/headers -I../ -Isrc/headers -D__ppc__ -D__e7__ -D__ARCH__=ppc
-D__PLATFORM__=e7 -Uppc -Ue7 -DDEBUG -include tomcrypt_opts.h
src/mont/fp_montgomery_reduce.c -mabi=no-spe -ansi -std=gnu99 -Wundef
-Wstrict-prototypes -Wpointer-arith -Wno-variadic-macros -Wsign-compare
-Werror-implicit-function-declaration -Wall -W -Wshadow
-fsingle-precision-constant -fno-strict-aliasing -fno-stack-protector
-funroll-loops -fomit-frame-pointer -fworking-directory -Os -O3
-fpch-preprocess -o fp_montgomery_reduce.i
ignoring duplicate directory "src/headers"
#include "..." search starts here:
#include <...> search starts here:
 /home/patrick/src/e7/prex
 /home/patrick/src/e7/prex/include
 /home/patrick/src/e7/prex/usr/include
 ../tfm/src/headers
 ../
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-I/home/patrick/src/e7/prex'
'-I/home/patrick/src/e7/prex/include' '-I/home/patrick/src/e7/prex/usr/include'
'-nostdinc' '-fsingle-precision-constant' '-mabi=no-spe' '-gdwarf-2' '-Os'
'-ansi' '-fno-strict-aliasing' '-Wundef' '-Wstrict-prototypes'
'-Wpointer-arith' '-std=gnu99' '-fno-stack-protector' '-Wno-variadic-macros'
'-D__ppc__' '-D__e7__' '-D__ARCH__=ppc' '-D__PLATFORM__=e7' '-Uppc' '-Ue7'
'-DDEBUG' '-g' '-Wsign-compare' '-Werror-implicit-function-declaration'
'-include' 'tomcrypt_opts.h' '-I../tfm/src/headers' '-I../' '-Wall' '-W'
'-Wshadow' '-Isrc/headers' '-O3' '-funroll-loops' '-fomit-frame-pointer' '-c'
'-o' 'src/mont/fp_montgomery_reduce.o'
 /home/patrick/src/e7/toolchain/stage2/libexec/gcc/powerpc-eabispe/4.3.2/cc1
-fpreprocessed fp_montgomery_reduce.i -quiet -dumpbase fp_montgomery_reduce.c
-mabi=no-spe -ansi -auxbase-strip src/mont/fp_montgomery_reduce.o -gdwarf-2 -g
-Os -O3 -Wundef -Wstrict-prototypes -Wpointer-arith -Wno-variadic-macros
-Wsign-compare -Werror-implicit-function-declaration -Wall -W -Wshadow -ansi
-std=gnu99 -version -fsingle-precision-constant -fno-strict-aliasing
-fno-stack-protector -funroll-loops -fomit-frame-pointer -o
fp_montgomery_reduce.s
GNU C (GCC) version 4.3.2 (powerpc-eabispe)
        compiled by GNU C version 4.2.3 (Ubuntu 4.2.3-2ubuntu7), GMP version
4.2.4, MPFR version 2.3.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c30b16423d0b6addaa52d5eb1153852d
src/mont/fp_montgomery_reduce.c: In function 'fp_montgomery_reduce':
src/mont/fp_montgomery_reduce.c:521: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:526: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:521: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:526: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:551: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:551: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c: At top level:
src/mont/fp_montgomery_reduce.c:551: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:551: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:551: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c: In function 'fp_montgomery_reduce':
src/mont/fp_montgomery_reduce.c:471: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:471: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:471: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:471: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:471: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:521: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:521: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:526: warning: matching constraint does not
allow a register
src/mont/fp_montgomery_reduce.c:526: warning: matching constraint does not
allow a register
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-I/home/patrick/src/e7/prex'
'-I/home/patrick/src/e7/prex/include' '-I/home/patrick/src/e7/prex/usr/include'
'-nostdinc' '-fsingle-precision-constant' '-mabi=no-spe' '-gdwarf-2' '-Os'
'-ansi' '-fno-strict-aliasing' '-Wundef' '-Wstrict-prototypes'
'-Wpointer-arith' '-std=gnu99' '-fno-stack-protector' '-Wno-variadic-macros'
'-D__ppc__' '-D__e7__' '-D__ARCH__=ppc' '-D__PLATFORM__=e7' '-Uppc' '-Ue7'
'-DDEBUG' '-g' '-Wsign-compare' '-Werror-implicit-function-declaration'
'-include' 'tomcrypt_opts.h' '-I../tfm/src/headers' '-I../' '-Wall' '-W'
'-Wshadow' '-Isrc/headers' '-O3' '-funroll-loops' '-fomit-frame-pointer' '-c'
'-o' 'src/mont/fp_montgomery_reduce.o'

/home/patrick/src/e7/toolchain/stage2/lib/gcc/powerpc-eabispe/4.3.2/../../../../powerpc-eabispe/bin/as
-mppc -mspe -me500 -many -V -Qy -o src/mont/fp_montgomery_reduce.o
fp_montgomery_reduce.s
GNU assembler version 2.18 (powerpc-eabispe) using BFD version (GNU Binutils)
2.18
fp_montgomery_reduce.s: Assembler messages:
fp_montgomery_reduce.s:504: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:504: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:507: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:507: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:519: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:519: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:522: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:522: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:534: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:534: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:537: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:537: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:549: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:549: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:552: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:552: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:563: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:563: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:566: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:566: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:577: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:577: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:580: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:580: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:604: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:604: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:607: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:607: Error: junk at end of line: `,3'
fp_montgomery_reduce.s:621: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:621: Error: junk at end of line: `,10'
fp_montgomery_reduce.s:624: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:624: Error: junk at end of line: `,10'
fp_montgomery_reduce.s:634: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:634: Error: junk at end of line: `,8'
fp_montgomery_reduce.s:637: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:637: Error: junk at end of line: `,8'
fp_montgomery_reduce.s:647: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:647: Error: junk at end of line: `,4'
fp_montgomery_reduce.s:650: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:650: Error: junk at end of line: `,4'
fp_montgomery_reduce.s:660: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:660: Error: junk at end of line: `,7'
fp_montgomery_reduce.s:663: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:663: Error: junk at end of line: `,7'
fp_montgomery_reduce.s:673: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:673: Error: junk at end of line: `,5'
fp_montgomery_reduce.s:676: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:676: Error: junk at end of line: `,5'
fp_montgomery_reduce.s:686: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:686: Error: junk at end of line: `,21'
fp_montgomery_reduce.s:689: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:689: Error: junk at end of line: `,21'
fp_montgomery_reduce.s:700: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:700: Error: junk at end of line: `,20'
fp_montgomery_reduce.s:703: Error: syntax error; found `,' but expected `('
fp_montgomery_reduce.s:703: Error: junk at end of line: `,20'


-- 
           Summary: Assembler failure: Error: syntax error; found `,' but
                    expected `('
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: patrick at motec dot com dot au
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: powerpc-eabispe-


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug inline-asm/37758] Assembler failure: Error: syntax error; found `,' but expected `('
  2008-10-06 23:06 [Bug inline-asm/37758] New: Assembler failure: Error: syntax error; found `,' but expected `(' patrick at motec dot com dot au
@ 2008-10-06 23:08 ` patrick at motec dot com dot au
  2008-10-06 23:12 ` patrick at motec dot com dot au
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: patrick at motec dot com dot au @ 2008-10-06 23:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from patrick at motec dot com dot au  2008-10-06 23:06 -------
Created an attachment (id=16468)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16468&action=view)
preprocessed source


-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug inline-asm/37758] Assembler failure: Error: syntax error; found `,' but expected `('
  2008-10-06 23:06 [Bug inline-asm/37758] New: Assembler failure: Error: syntax error; found `,' but expected `(' patrick at motec dot com dot au
  2008-10-06 23:08 ` [Bug inline-asm/37758] " patrick at motec dot com dot au
@ 2008-10-06 23:12 ` patrick at motec dot com dot au
  2008-10-06 23:14 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: patrick at motec dot com dot au @ 2008-10-06 23:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from patrick at motec dot com dot au  2008-10-06 23:10 -------
The problem appears to be that the loop

       for (; y < pa; y++) {
          asm(" mullw    16,%3,%4       \n\t"
              " mulhwu   17,%3,%4       \n\t"
              " addc     16,16,%0       \n\t"
              " addze    17,17          \n\t"
              " lwz      18,%1          \n\t"
              " addc     16,16,18       \n\t"
              " addze    %0,17          \n\t"
              " stw      16,%1          \n\t"
             
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17",
"18","%cc"); ++tmpm;;
          ++_c;
       }

is being unrolled, resulting in

 # 521 "src/mont/fp_montgomery_reduce.c" 1
         mullw    16,28,0       
         mulhwu   17,28,0       
         addc     16,16,11       
         addze    17,17          
         lwz      18,4(29)          
         addc     16,16,18       
         addze    11,17          
         stw      16,4(29)          

 # 0 "" 2
.L335:
        lwzx 5,31,3
 # 521 "src/mont/fp_montgomery_reduce.c" 1
         mullw    16,28,5       
         mulhwu   17,28,5       
         addc     16,16,11       
         addze    17,17          
         lwz      18,29,3          
         addc     16,16,18       
         addze    11,17          
         stw      16,29,3          

 # 0 "" 2
        addi 3,3,4

and so on...

where the "lwz      18,29,3" is not understood by the assembler.

I am currently working around this problem by making the variable _c volatile,
which prevents the loop from being unrolled.


-- 

patrick at motec dot com dot au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.3.0 4.3.1 4.3.2
      Known to work|                            |4.1.1 4.1.2


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug inline-asm/37758] Assembler failure: Error: syntax error; found `,' but expected `('
  2008-10-06 23:06 [Bug inline-asm/37758] New: Assembler failure: Error: syntax error; found `,' but expected `(' patrick at motec dot com dot au
  2008-10-06 23:08 ` [Bug inline-asm/37758] " patrick at motec dot com dot au
  2008-10-06 23:12 ` patrick at motec dot com dot au
@ 2008-10-06 23:14 ` pinskia at gcc dot gnu dot org
  2008-10-06 23:32 ` patrick at motec dot com dot au
  2008-10-07  7:56 ` schwab at suse dot de
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-10-06 23:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2008-10-06 23:12 -------
You either need to require [reg+offset] or use stw%U0%X0 for the "m"
constraint.

Likewise for lwz.

The other question is why are you using inline-asm in the first place for the
load/stores.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|4.3.0 4.3.1 4.3.2           |
      Known to work|4.1.1 4.1.2                 |


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug inline-asm/37758] Assembler failure: Error: syntax error; found `,' but expected `('
  2008-10-06 23:06 [Bug inline-asm/37758] New: Assembler failure: Error: syntax error; found `,' but expected `(' patrick at motec dot com dot au
                   ` (2 preceding siblings ...)
  2008-10-06 23:14 ` pinskia at gcc dot gnu dot org
@ 2008-10-06 23:32 ` patrick at motec dot com dot au
  2008-10-07  7:56 ` schwab at suse dot de
  4 siblings, 0 replies; 6+ messages in thread
From: patrick at motec dot com dot au @ 2008-10-06 23:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from patrick at motec dot com dot au  2008-10-06 23:31 -------
I'm not personally responsible for this code, it is part of the LibTomMath
library.

Changing the constraint to either =o or =g appears to resolve the problem (will
need to test).


-- 

patrick at motec dot com dot au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.3.0 4.3.1 4.3.2
      Known to work|                            |4.1.1 4.1.2


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug inline-asm/37758] Assembler failure: Error: syntax error; found `,' but expected `('
  2008-10-06 23:06 [Bug inline-asm/37758] New: Assembler failure: Error: syntax error; found `,' but expected `(' patrick at motec dot com dot au
                   ` (3 preceding siblings ...)
  2008-10-06 23:32 ` patrick at motec dot com dot au
@ 2008-10-07  7:56 ` schwab at suse dot de
  4 siblings, 0 replies; 6+ messages in thread
From: schwab at suse dot de @ 2008-10-07  7:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from schwab at suse dot de  2008-10-07 07:55 -------
Invalid asm constraints, so not a gcc bug.


-- 

schwab at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
  GCC build triplet|x86_64-unknown-linux-gnu    |
   GCC host triplet|x86_64-unknown-linux-gnu    |
         Resolution|                            |INVALID


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-10-07  7:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-06 23:06 [Bug inline-asm/37758] New: Assembler failure: Error: syntax error; found `,' but expected `(' patrick at motec dot com dot au
2008-10-06 23:08 ` [Bug inline-asm/37758] " patrick at motec dot com dot au
2008-10-06 23:12 ` patrick at motec dot com dot au
2008-10-06 23:14 ` pinskia at gcc dot gnu dot org
2008-10-06 23:32 ` patrick at motec dot com dot au
2008-10-07  7:56 ` schwab at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).