public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/111231] [12/13/14 regression] armhf: Miscompilation with -O2/-fno-exceptions level (-fno-tree-vectorize is working)
Date: Thu, 11 Apr 2024 18:25:22 +0000	[thread overview]
Message-ID: <bug-111231-4-fuTQv9Atwn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111231-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #24 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Earnshaw from comment #21)
> With my new testcase, compiled on an arm-none-eabi cross with 
> 
> cc1plus ../hwy-pr111231-cpp.cc -mfpu=neon-vfpv4 -mfloat-abi=hard
> -mfp16-format=ieee -marm -mlibarch=armv7-a+neon-vfpv4
> -march=armv7-a+neon-vfpv4 -O2 -fPIE -fvisibility=hidden
> -fvisibility-inlines-hidden -fmerge-all-constants -fmath-errno
> -fno-exceptions
> 
> The critical sequence, at the end of gimple optimization is:
> 
>   v = b;
>   MEM <unsigned char[16]> [(char * {ref-all})&D.33805] = MEM <unsigned
> char[16]> [(char * {ref-all})&v];
>   v ={v} {CLOBBER(eol)};
>   v = D.33805;
>   vect__239.652_700 = MEM <vector(8) short int> [(short int *)&v];
>   vect__240.653_702 = vect__239.652_700 << 8;
> 
> This generates the following (pseudo) rtl:
> 
> ; D.33805 = _179
>   113: r215:SI=r109:SI-0x10
>   114: {r0:SI..r3:SI} = [r215:SI (0 MEM <unsigned char[16]> [(char *
> {ref-all})_179]+0 S4 A64)]
>   112: r214:SI=r109:SI-0x60
>   115: [r214:SI (0 MEM <unsigned char[16]> [(char * {ref-all})&D.33805]+0 S4
> A64)] = {r0:SI..r3:SI}
> ; _179 = D.33805
>   117: r217:SI=r109:SI-0x60
>   118: {r0:SI..r3:SI} = [r217:SI (2 D.33805+0 S4 A64)]
>   116: r216:SI=r109:SI-0x10
> * 119: [r216:SI (2 MEM[(struct Vec128<short int, 8> *)_179]+0 S4 A64)] =
> {r0:SI..r3:SI}
> ; r218 = _179
> * 120: r218:V8HI=[r109:SI-0x10 (3 MEM <vector(8) short int> [(short int
> *)_179]+0 S16 A64)]
>   121: r178:V8HI=unspec[r218:V8HI,const_vector] 451
> 
> The two key instructions have been starred. 
> 
> Things proceed OK until sched2, at which point, when building the
> dependencies, we fail to create a link between i119 and i120.  I've tracked
> this as far as ptr_deref_may_alias_decl_p (), where the call to
> may_be_aliased () decides that D.33805 cannot be aliased and thus there's no
> dependency.  But it's not clear to me why we've tracked back to the copy
> before the load of interest, nor why, at this point, we're looking at tree
> addressability to decide whether or not there are memory dependencies here.

This making it sound like one of the -fstack-reuse= issues (see the linked bug
reports from PR 111843). Does -fstack-reuse=none help?

  parent reply	other threads:[~2024-04-11 18:25 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30  6:47 [Bug target/111231] New: armhf: Miscompilation at O2 level malat at debian dot org
2023-08-30  6:49 ` [Bug target/111231] " malat at debian dot org
2023-08-30  6:51 ` malat at debian dot org
2023-08-30  7:18 ` [Bug target/111231] armhf: Miscompilation at O2 level (O1 is working) malat at debian dot org
2023-08-31  6:49 ` malat at debian dot org
2023-09-05 16:24 ` malat at debian dot org
2023-09-14 13:52 ` [Bug target/111231] [13/14 Regression] " malat at debian dot org
2023-09-15  8:06 ` [Bug target/111231] armhf: Miscompilation with -O2/-fno-exceptions level (-O2 " malat at debian dot org
2023-09-26  6:29 ` malat at debian dot org
2023-09-26  6:29 ` malat at debian dot org
2023-09-26  6:31 ` malat at debian dot org
2023-09-26  6:32 ` malat at debian dot org
2023-09-26  9:00 ` xry111 at gcc dot gnu.org
2023-10-06  6:16 ` [Bug target/111231] armhf: Miscompilation with -O2/-fno-exceptions level (-fno-tree-vectorize " malat at debian dot org
2023-10-06  6:21 ` malat at debian dot org
2023-10-06  6:47 ` malat at debian dot org
2023-12-15  7:33 ` malat at debian dot org
2024-03-17  2:44 ` [Bug target/111231] [12/13/14 regression] " sjames at gcc dot gnu.org
2024-03-17  2:46 ` sjames at gcc dot gnu.org
2024-03-22 13:39 ` law at gcc dot gnu.org
2024-03-22 18:02 ` rearnsha at gcc dot gnu.org
2024-03-25 12:46 ` rguenth at gcc dot gnu.org
2024-04-11 14:13 ` rearnsha at gcc dot gnu.org
2024-04-11 14:28 ` rearnsha at gcc dot gnu.org
2024-04-11 14:29 ` rearnsha at gcc dot gnu.org
2024-04-11 14:41 ` rearnsha at gcc dot gnu.org
2024-04-11 18:25 ` pinskia at gcc dot gnu.org [this message]
2024-04-12  6:17 ` rguenth at gcc dot gnu.org
2024-04-12 10:08 ` rearnsha at gcc dot gnu.org
2024-04-12 10:40 ` rearnsha at gcc dot gnu.org
2024-04-12 10:51 ` rguenth at gcc dot gnu.org
2024-04-12 13:10 ` rearnsha at gcc dot gnu.org
2024-04-15  6:46 ` rguenth at gcc dot gnu.org
2024-04-15 14:47 ` rearnsha at gcc dot gnu.org
2024-04-16  6:46 ` rguenth at gcc dot gnu.org
2024-04-16  6:57 ` rguenth at gcc dot gnu.org
2024-04-16  9:59 ` rearnsha at gcc dot gnu.org
2024-04-16 10:34 ` rguenther at suse dot de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-111231-4-fuTQv9Atwn@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).