public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/66768] New: __seg_fs and __seg_gs: issue when adding address space support
@ 2015-07-05 17:29 arigo at tunes dot org
  2015-07-05 17:37 ` [Bug c/66768] " arigo at tunes dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: arigo at tunes dot org @ 2015-07-05 17:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66768
           Summary: __seg_fs and __seg_gs: issue when adding address space
                    support
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arigo at tunes dot org
  Target Milestone: ---

Created attachment 35913
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35913&action=edit
Input incorrectly compiled with gcc-5.1.0-patched

I implemented support for %fs and %gs segment prefixes on the x86 and
x86-64 platforms, in what turns out to be a small patch.  A full description
and the motivation can be found in
https://gcc.gnu.org/ml/gcc/2015-07/msg00031.html .

This bug report is unusual in that it is not about a bug in the current version
of gcc, but in the gcc with a patch added
(https://gcc.gnu.org/ml/gcc/2015-07/txtJZYwz9PTTI.txt).  It might of course be
that my patch is incorrect, but the patch really only adds two extra address
spaces; given that it is straightforward, I'd guess there is a chance that the
same bug occurs on other platforms that already have multiple address spaces. 
(Either that, or some code somewhere is confused by the standard-sized,
alternate-address-spaced pointers.)

The bug is that with gcc 5.1.0 patched as above, compiling bug1.c on x86-64
with "-O1" produces https://gcc.gnu.org/ml/gcc/2015-07/msg00031/bug1.s.  In one
case, the __seg_gs address space is incorrectly dropped.  With "-O0" it works
fine.  If I try to dump all the rtl passes, I see that the __seg_gs address
space is already missing in the first rtl dump, so I suspect that some earlier
optimization does not respect the presence of address spaces.

(I tried to replace the "-O1" with the list of "-f" flags output by "-O1 -Q
--help=optimizers" with the goal of removing most of them until I can pinpoint
which optimization causes the problem, but with no luck: even replacing "-O1"
by all the [enabled] flags produces a different and correct result...)


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

end of thread, other threads:[~2015-07-20 18:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-05 17:29 [Bug c/66768] New: __seg_fs and __seg_gs: issue when adding address space support arigo at tunes dot org
2015-07-05 17:37 ` [Bug c/66768] " arigo at tunes dot org
2015-07-05 18:00 ` arigo at tunes dot org
2015-07-06  7:08 ` [Bug tree-optimization/66768] " rguenth at gcc dot gnu.org
2015-07-06  7:39 ` amker at gcc dot gnu.org
2015-07-07  3:24 ` amker at gcc dot gnu.org
2015-07-07  8:29 ` [Bug tree-optimization/66768] address space gets lost on literal pointer rguenth at gcc dot gnu.org
2015-07-07  8:43 ` amker at gcc dot gnu.org
2015-07-07 11:17 ` amker at gcc dot gnu.org
2015-07-07 11:20 ` rguenther at suse dot de
2015-07-20 18:44 ` gjl 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).