[Bug c/24863] New: New __attribute__((alias("target"))) requirement break aliasing assembler functions
The new requirement for (weak) symbol aliasing: Given __attribute__((alias("target"))) it is now an error if target is not a symbol, defined in the same translation unit. This also applies to aliases created by #pragma weak alias=target. This is because it's meaningless to define an alias to an undefined symbol. On Solaris, the native assembler would have caught this error, but GNU as does not. breaks compilation of code like this (example from an sh-elf target, but the effect is architecture-independent): extern __attribute__((weak,alias("UIE11"))) void NMI(void); void UIE11 (void); asm( "_UIE11:[EMAIL PROTECTED],r4\t\n" ); which is perfectly valid and worked in all of gcc 3.0.x, gcc 3.3.x and gcc 3.4.x -- Summary: New __attribute__((alias("target"))) requirement break aliasing assembler functions Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: arnold-j at t-online dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24863
[Bug c/24863] New __attribute__((alias("target"))) requirement break aliasing assembler functions
-- arnold-j at t-online dot de changed: What|Removed |Added Severity|normal |major GCC target triplet||all Keywords||rejects-valid http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24863
[Bug c/24863] New __attribute__((alias("target"))) requirement break aliasing assembler functions
--- Comment #2 from arnold-j at t-online dot de 2005-11-14 22:55 --- I am indeed hiding a lot of code, but hopefully in order to pinpoint the issue. This code snippet is taken from the rockbox project http://www.rockbox.org/ , precisely from http://www.rockbox.org/viewcvs.cgi/firmware/system.c?annotate=1.73 Check lines 652-1019. This is part of the exception handling on the SH1 target CPU. All exceptions are handled in one C handler function, UIE(). However, the only way to get the exception number on SH1 is checking the called handler address, so all exceptions that aren't handled by other code are handled by tiny assembler snippets which just fetch their callee address and pass it to UIE(), which then checks the address it was called from. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24863
[Bug c/24863] New __attribute__((alias("target"))) requirement break aliasing assembler functions
--- Comment #4 from arnold-j at t-online dot de 2005-11-14 23:16 --- How do you mean, it seems like a hack? Obviously we can't put the asm in a different file, because then the symbols would clearly be defined in a different translation unit. As-is they are not, but gcc 4.0.x errors because it doesn't see the symbols in the inline asm. There are two main points which require the code to work like it does: (1) As mentioned, the exception number can only be derived from the called address. UIE() is there to catch all unexpected interrupts and exceptions, i.e. those for which there are no specific handlers. That's why all _UIE##number symbols are defined in the asm block, in a regular structure that allows to compute the vector number from the called address easily. (2) We need to weak-alias these asm symbols because they should only be used when there is no dedicated handler for the specific interrupt or exception defined in any other source file. Perhaps it would be possible to hard code which handlers are implemented elsewhere and which are not, but that would be rather hard to maintain. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24863
[Bug middle-end/23442] Compiler fails to build - internal compiler error: in do_SUBST, at combine.c:462
--- Comment #2 from arnold-j at t-online dot de 2006-03-21 21:11 --- This happens with *all* versions of m68k-elf-gcc I tried to build (3.3.6, 3.4.5, 3.4.6, 4.0.2, 4.0.3). Host gcc: gcc version 4.0.3 20060212 (prerelease) (Debian 4.0.2-9) Example: m68k-elf-gcc 3.4.6, configured with: ../../gcc-3.4.6/configure --target=m68k-elf --prefix=/opt/m68k --enable-languages=c Result: /home/jens/build/gcc/gcc/xgcc -B/home/jens/build/gcc/gcc/ -B/opt/m68k/m68k-elf/bin/ -B/opt/m68k/m68k-elf/lib/ -isystem /opt/m68k/m68k-elf/include -isystem /opt/m68k/m68k-elf/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../../gcc-3.4.6/gcc -I../../../gcc-3.4.6/gcc/. -I../../../gcc-3.4.6/gcc/../include -m68000 -DL_fixdfdi -c ../../../gcc-3.4.6/gcc/libgcc2.c -o libgcc/m68000/_fixdfdi.o ../../../gcc-3.4.6/gcc/libgcc2.c: In function `__fixdfdi': ../../../gcc-3.4.6/gcc/libgcc2.c:1277: internal compiler error: in do_SUBST, at combine.c:447 Please submit a full bug report, with preprocessed source if appropriate. See http://gcc.gnu.org/bugs.html> for instructions. make[2]: *** [libgcc/m68000/_fixdfdi.o] Fehler 1 make[2]: Leaving directory `/home/jens/build/gcc/gcc' make[1]: *** [stmp-multilib] Fehler 2 make[1]: Leaving directory `/home/jens/build/gcc/gcc' make: *** [all-gcc] Fehler 2 The line numbers vary with gcc versions, but it's always an ICE of xgcc in do_SUBST (combine.c), trying to compile _fixdfdi (libgcc2.c) -- arnold-j at t-online dot de changed: What|Removed |Added CC| |arnold-j at t-online dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23442
[Bug middle-end/23442] Compiler fails to build - internal compiler error: in do_SUBST, at combine.c:462
--- Comment #3 from arnold-j at t-online dot de 2006-03-21 21:30 --- Created an attachment (id=11085) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11085&action=view) The preprocessed source file causing the error -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23442