public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/108061] New: '-fcompare-debug' failure (length) w/ -m32 -O2
@ 2022-12-11 14:55 asolokha at gmx dot com
  2022-12-11 14:58 ` [Bug debug/108061] " asolokha at gmx dot com
  0 siblings, 1 reply; 2+ messages in thread
From: asolokha at gmx dot com @ 2022-12-11 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108061
           Summary: '-fcompare-debug' failure (length) w/ -m32 -O2
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: compare-debug-failure
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: powerpc-e300c3-linux-gnu

Created attachment 54065
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54065&action=edit
gkd diff

gcc 13.0.0 20221204 snapshot (g:24b9337d1f1b5197b6498dceb9074319be003449) fails
-fcompare-debug check when compiling the following testcase w/ -m32 -O2
-fcompare-debug:

volatile unsigned short int m;
volatile signed short int n;

int
sub (int x, int y)
{
  return x - y;
}

unsigned int
quux (int x)
{
  return x ? x : 1;
}

int
bar (int x, int y)
{
  return sub (n < x, quux (y) + 1);
}

int
foo (int x)
{
  return bar (m, quux (3));
}

% powerpc-e300c3-linux-gnu-gcc-13 -m32 -O2 -fcompare-debug -c ndat8d3d.c
powerpc-e300c3-linux-gnu-gcc-13: error: ndat8d3d.c: '-fcompare-debug' failure
(length)

gkd diff attached.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug debug/108061] '-fcompare-debug' failure (length) w/ -m32 -O2
  2022-12-11 14:55 [Bug debug/108061] New: '-fcompare-debug' failure (length) w/ -m32 -O2 asolokha at gmx dot com
@ 2022-12-11 14:58 ` asolokha at gmx dot com
  0 siblings, 0 replies; 2+ messages in thread
From: asolokha at gmx dot com @ 2022-12-11 14:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Arseny Solokha <asolokha at gmx dot com> ---
Created attachment 54066
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54066&action=edit
gkd diff #2

The following change yields the attached fiff instead:

@ -16,7 +16,7 @@ quux (int x)
 int
 bar (int x, int y)
 {
-  return sub (n < x, quux (y) + 1);
+  return sub (n < x, quux (y) + 1 + x);
 }

 int

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-11 14:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-11 14:55 [Bug debug/108061] New: '-fcompare-debug' failure (length) w/ -m32 -O2 asolokha at gmx dot com
2022-12-11 14:58 ` [Bug debug/108061] " asolokha at gmx dot com

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