https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116933

            Bug ID: 116933
           Summary: Ada FE incompatible with -ftrivial-auto-var-init=zero
                    (__builtin_clear_padding not folded)
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: dkm at gcc dot gnu.org, qing.zhao at oracle dot com
  Target Milestone: ---

Hit this when bootstrapping with a GCC that defaulted to
-ftrivial-auto-var-init=zero.

hello.adb:
```
with Text_IO; use Text_IO;
procedure hello is
begin
   Put_Line("Hello world!");
end hello;
```

```
$ gnatmake hello.adb -ftrivial-auto-var-init=zero -f -v

GNATMAKE 15.0.0 20241001 (experimental)
f72b1a44ff582041b02d5abe0a6c8556057e6183
Copyright (C) 1992-2024, Free Software Foundation, Inc.
gcc -c -ftrivial-auto-var-init=zero hello.adb
  "text_io.ali" is a read-only library
End of compilation
gnatbind -x hello.ali
gnatlink hello.ali -ftrivial-auto-var-init=zero
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld:
b~hello.o: in function `ada_main___elabb':
b~hello.adb:(.text+0x578): undefined reference to `__builtin_clear_padding'
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld:
./hello.o: in function `_ada_hello':
hello.adb:(.text+0x3a): undefined reference to `__builtin_clear_padding'
collect2: error: ld returned 1 exit status
gnatlink: error when calling /usr/bin/gcc
gnatmake: *** link failed.
```

Reply via email to