public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6838] testsuite: Compile-only gcc.dg/tree-ssa/pr100359.c if ! natural_alignment_32
@ 2023-03-23 20:49 Hans-Peter Nilsson
  0 siblings, 0 replies; only message in thread
From: Hans-Peter Nilsson @ 2023-03-23 20:49 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:08981d59253ef500a1f6eb19352110562a63d30e

commit r13-6838-g08981d59253ef500a1f6eb19352110562a63d30e
Author: Hans-Peter Nilsson <hp@axis.com>
Date:   Tue Mar 21 16:09:23 2023 +0100

    testsuite: Compile-only gcc.dg/tree-ssa/pr100359.c if ! natural_alignment_32
    
    The test gcc.dg/tree-ssa/pr100359.c fails the "test for
    excess errors" for at least m68k-linux, pru-elf, and
    cris-elf according to posts on gcc-testresults.  For
    cris-elf, the "excess errors" is a failure to link; an
    undefined reference to foo, because the code has a call to
    an extern function foo, which is not optimized away, and
    which is not defined.  I guess it's the same for those other
    targets.
    
    From comparative gdb sessions for native x86_64-linux and
    cris-elf, I see tree-ssa-sccvn.cc:vn_reference_lookup_3
    (called from the "pre" pass) requires int-size-alignment for
    a target to see through the "int *" dereference, that the
    expression is constant false and subsequently optimize away
    the call to foo.  The conclusion is with substantially less
    effort available from comments in PR91419.
    
    The point of the test seems only incidental to
    optimizing-out the call to foo, judging from the comments in
    PR100359, so an alternative is compile it (not link it) for
    all targets.  However, I chose to not change the nature of
    the test where it passes.
    
            * gcc.dg/tree-ssa/pr100359.c: Compile-only for ! natural_alignment_32.

Diff:
---
 gcc/testsuite/gcc.dg/tree-ssa/pr100359.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr100359.c b/gcc/testsuite/gcc.dg/tree-ssa/pr100359.c
index 29243522caa..236dbef41c4 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr100359.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr100359.c
@@ -1,4 +1,5 @@
-/* { dg-do link } */
+/* { dg-do link { target natural_alignment_32 } } */
+/* { dg-do compile { target { ! natural_alignment_32 } } } */
 /* { dg-options "-O3 -fdump-tree-cunrolli-optimized" } */
 
 extern void foo(void);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-23 20:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23 20:49 [gcc r13-6838] testsuite: Compile-only gcc.dg/tree-ssa/pr100359.c if ! natural_alignment_32 Hans-Peter Nilsson

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).