On Thu, Jan 8, 2026 at 8:06 PM Jan Hubicka <[email protected]> wrote:
>
> > Change in v3:
> > Add safe_as_a<asm_node*> needed for rebase.
> >
> > ---
> >
> > Analyzes references from toplevel extended assembly.
> >
> > We cannot perform IPA optimizations with toplevel assembly, so
> > symtab_node only needs ref_by_asm to know that it should not be removed.
> >
> > PR ipa/122458
> >
> > gcc/ChangeLog:
> >
> > * Makefile.in: Add new file.
> > * cgraph.h (analyze_toplevel_extended_asm): New.
> > * cgraphunit.cc (symbol_table::finalize_compilation_unit):
> > Call analyze_toplevel_extended_asm.
> > * asm-toplevel.cc: New file.
> >
> > gcc/lto/ChangeLog:
> >
> > * lto-common.cc (read_cgraph_and_symbols):
> > Call analyze_toplevel_extended_asm.
> >
> > gcc/testsuite/ChangeLog:
> >
> > * gcc.dg/ipa/pr122458.c: New test.
> OK,
> Thanks!
> Honza
The new test doesn't work for -m32:
Executing on host:
/export/build/gnu/tools-build/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/tools-build/gcc/build-x86_64-linux/gcc/
/export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.dg/ipa/pr122458.c
-m32 -fdiagnostics-plain-output -O2 -lm -o pr122458.exe
(timeout = 300)
spawn -ignore SIGHUP
/export/build/gnu/tools-build/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/tools-build/gcc/build-x86_64-linux/gcc/
/export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.dg/ipa/pr122458.c
-m32 -fdiagnostics-plain-output -O2 -lm -o pr122458.exe
/usr/local/bin/as: /tmp/cc9Bw0pX.o: unsupported relocation type: 0x1
/tmp/ccGrIiOC.s: Assembler messages:
/tmp/ccGrIiOC.s:4: Error: cannot represent relocation type BFD_RELOC_64
compiler exited with status 1
FAIL: gcc.dg/ipa/pr122458.c (test for excess errors)
Excess errors:
/usr/local/bin/as: /tmp/cc9Bw0pX.o: unsupported relocation type: 0x1
/tmp/ccGrIiOC.s:4: Error: cannot represent relocation type BFD_RELOC_64
I am checking in this an abviouse fix.
--
H.J.
---
diff --git a/gcc/testsuite/gcc.dg/ipa/pr122458.c
b/gcc/testsuite/gcc.dg/ipa/pr122458.c
index bec608ad486..b4ed390cea7 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr122458.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr122458.c
@@ -4,6 +4,6 @@
static int foo (void) { return 0; };
-asm (".quad %c0" :: "i" (foo));
+asm (".dc.a %c0" :: "i" (foo));
int main() {}