Prevent inlining in gdb.base/vla-optimized-out.c
authorGary Benson <gbenson@redhat.com>
Tue, 10 Nov 2020 16:40:40 +0000 (16:40 +0000)
committerGary Benson <gbenson@redhat.com>
Tue, 10 Nov 2020 16:40:40 +0000 (16:40 +0000)
The function f1 in gdb.base/vla-optimized-out.c sets various
attributes to prevent its being inlined, but Clang inlines it
anyway, causing the test that uses it to fail.  This commit
adds the "weak" attribute to cause Clang to keep the function
fully out of line so the test can operate as it should.

gdb/testsuite/ChangeLog:

* gdb.base/vla-optimized-out.c (f1): Add __attribute__ ((weak)).

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/vla-optimized-out.c

index 863dcc43463548aa8bec50de469582b49068315d..146fa1a086f144dfd75bd353d48409dcf913043f 100644 (file)
@@ -1,3 +1,7 @@
+2020-11-10  Gary Benson <gbenson@redhat.com>
+
+       * gdb.base/vla-optimized-out.c (f1): Add __attribute__ ((weak)).
+
 2020-11-10  Gary Benson <gbenson@redhat.com>
 
        * gdb.cp/step-and-next-inline.exp: Only require
index d21df7a153e94c940fdb6853966100b03d6ba7c6..1bd4f6d140630df006e5724a0ccb3caf64d5b7b5 100644 (file)
@@ -22,9 +22,9 @@
 
 int
 #ifdef NOCLONE
-__attribute__((noinline)) ATTRIBUTE_NOCLONE
+__attribute__((noinline,weak)) ATTRIBUTE_NOCLONE
 #else
-__attribute__((noinline))
+__attribute__((noinline,weak))
 #endif
 f1 (int i)
 {
This page took 0.038173 seconds and 4 git commands to generate.