public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/114222] New: gcc.c-torture/execute/builtin-bitops-1.c fails for H8/300
@ 2024-03-03 18:02 jdx at o2 dot pl
  2024-03-04 10:13 ` [Bug target/114222] " rguenth at gcc dot gnu.org
  2024-03-08 22:30 ` law at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: jdx at o2 dot pl @ 2024-03-03 18:02 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114222
           Summary: gcc.c-torture/execute/builtin-bitops-1.c fails for
                    H8/300
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jdx at o2 dot pl
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: h8300-elf

Excerpt from gcc.log:
[...]
Executing on host: /home/jdx/testgcc/builddir/gcc/xgcc
-B/home/jdx/testgcc/builddir/gcc/
/home/jdx/testgcc/combosrc/gcc/testsuite/gcc.c-torture/execute/builtin-bitops-1.c
   -fdiagnostics-plain-output    -O0  -w  -isystem
/home/jdx/testgcc/builddir/h8300-elf/./newlib/targ-include -isystem
/home/jdx/testgcc/combosrc/newlib/libc/include -L/home/jdx/testgcc/builddir/ld
-B/home/jdx/testgcc/builddir/h8300-elf/./newlib/
-L/home/jdx/testgcc/builddir/h8300-elf/./newlib  -lm  -o ./builtin-bitops-1.exe
   (timeout = 300)
spawn -ignore SIGHUP /home/jdx/testgcc/builddir/gcc/xgcc
-B/home/jdx/testgcc/builddir/gcc/
/home/jdx/testgcc/combosrc/gcc/testsuite/gcc.c-torture/execute/builtin-bitops-1.c
-fdiagnostics-plain-output -O0 -w -isystem
/home/jdx/testgcc/builddir/h8300-elf/./newlib/targ-include -isystem
/home/jdx/testgcc/combosrc/newlib/libc/include -L/home/jdx/testgcc/builddir/ld
-B/home/jdx/testgcc/builddir/h8300-elf/./newlib/
-L/home/jdx/testgcc/builddir/h8300-elf/./newlib -lm -o ./builtin-bitops-1.exe
PASS: gcc.c-torture/execute/builtin-bitops-1.c   -O0  (test for excess errors)
spawn /home/jdx/testgcc/builddir/sim/h8300/run ./builtin-bitops-1.exe
program stopped with signal 4 (Illegal instruction).
FAIL: gcc.c-torture/execute/builtin-bitops-1.c   -O0  execution test
[...]

Further investigation showed that:
 a) the test case fails at line 181, (most likely) inside __builtin_ffs();
other __builtins work as expected,
 b) it happens when the test case is compiled with default options, i.e. when
ints are 16 bit wide; when -mint32 is added to the options (i.e. ints are 32
bit wide), the test passes.

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

* [Bug target/114222] gcc.c-torture/execute/builtin-bitops-1.c fails for H8/300
  2024-03-03 18:02 [Bug testsuite/114222] New: gcc.c-torture/execute/builtin-bitops-1.c fails for H8/300 jdx at o2 dot pl
@ 2024-03-04 10:13 ` rguenth at gcc dot gnu.org
  2024-03-08 22:30 ` law at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-03-04 10:13 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|testsuite                   |target
           Keywords|                            |testsuite-fail, wrong-code

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
SIGILL looks like a target issue, but it might be also an emulator bug?

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

* [Bug target/114222] gcc.c-torture/execute/builtin-bitops-1.c fails for H8/300
  2024-03-03 18:02 [Bug testsuite/114222] New: gcc.c-torture/execute/builtin-bitops-1.c fails for H8/300 jdx at o2 dot pl
  2024-03-04 10:13 ` [Bug target/114222] " rguenth at gcc dot gnu.org
@ 2024-03-08 22:30 ` law at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-08 22:30 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu.org

--- Comment #2 from Jeffrey A. Law <law at gcc dot gnu.org> ---
More likely the test is running out of address space.

The default linker script has a pretty small address space and the text will
commonly clash with the heap/stack.  Naturally that corrupts the text segment
causing all kinds of interesting problems -- worse yet, the problems are
intermittent as they depend on precisely what gets clobbered within the text
segment and what value ends up in the text segment.

The easiest way to check for that is throw the test into the debugger and run
it.  Assuming it faults, disassemble the instruction at the fault point.  Then
use objdump to disassemble the binary and see if the instruction has been
changed.

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

end of thread, other threads:[~2024-03-08 22:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-03 18:02 [Bug testsuite/114222] New: gcc.c-torture/execute/builtin-bitops-1.c fails for H8/300 jdx at o2 dot pl
2024-03-04 10:13 ` [Bug target/114222] " rguenth at gcc dot gnu.org
2024-03-08 22:30 ` law at gcc dot gnu.org

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