public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/94541] New: -mx32 gcc produces wrong code passing structs by value
@ 2020-04-09 13:48 ibuclaw at gdcproject dot org
  2020-04-09 13:55 ` [Bug target/94541] " ibuclaw at gdcproject dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: ibuclaw at gdcproject dot org @ 2020-04-09 13:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94541
           Summary: -mx32 gcc produces wrong code passing structs by value
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ibuclaw at gdcproject dot org
  Target Milestone: ---

Created attachment 48250
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48250&action=edit
test case

Attached reduced example.

Compiled with 'g++ -Wall -Wextra -fno-strict-aliasing -fwrapv', the run-time
results of the following combinations:

-O0 -m64:   0  0
-O1 -m64:   0  0
-O2 -m64:   0  0
-O3 -m64:   0  0
-O0 -m32:   0  0
-O1 -m32:   0  0
-O2 -m32:   0  0
-O3 -m32:   0  0
-O0 -mx32:  0  0
-O1 -mx32: -1 22  // munmap failed, EINVAL
-O2 -mx32: -1 22
-O3 -mx32: -1 22

A failure is not observed when:

- The condition is: if (b.ptr && b.length)
- The condition is: if (b.length)
- The ptr and length fields in Array are swapped.
- Array is passed by reference.


Tested with 8.4.0, 9.2.0, and 10.0.1.  All have the same problem.

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

end of thread, other threads:[~2020-04-10 11:20 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 13:48 [Bug target/94541] New: -mx32 gcc produces wrong code passing structs by value ibuclaw at gdcproject dot org
2020-04-09 13:55 ` [Bug target/94541] " ibuclaw at gdcproject dot org
2020-04-09 14:40 ` jakub at gcc dot gnu.org
2020-04-09 15:29 ` [Bug target/94541] [8/9/10 Regression] " hjl.tools at gmail dot com
2020-04-09 16:57 ` ibuclaw at gdcproject dot org
2020-04-09 16:59 ` ibuclaw at gdcproject dot org
2020-04-09 20:31 ` hjl.tools at gmail dot com
2020-04-09 20:32 ` hjl.tools at gmail dot com
2020-04-09 20:42 ` [Bug middle-end/94541] " hjl.tools at gmail dot com
2020-04-09 20:53 ` pinskia at gcc dot gnu.org
2020-04-09 21:04 ` hjl.tools at gmail dot com
2020-04-09 21:07 ` hjl.tools at gmail dot com
2020-04-09 21:32 ` pinskia at gcc dot gnu.org
2020-04-09 22:28 ` hjl.tools at gmail dot com
2020-04-09 22:32 ` [Bug target/94541] " pinskia at gcc dot gnu.org
2020-04-09 23:24 ` hjl.tools at gmail dot com
2020-04-09 23:28 ` hjl.tools at gmail dot com
2020-04-10 10:57 ` hjl.tools at gmail dot com
2020-04-10 11:20 ` ibuclaw at gdcproject dot 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).