public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/64941] New: -O3 breaks tar
@ 2015-02-05  5:22 brian at soulspark dot org
  2015-02-05  5:28 ` [Bug c/64941] " brian at soulspark dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: brian at soulspark dot org @ 2015-02-05  5:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64941
           Summary: -O3 breaks tar
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: brian at soulspark dot org

While emerging my gentoo I ended up with a version of tar-1.27.1 that wouldn't
extract one particular package: sys-apps/kbd-1.15.5 (although it worked on
other packages)

The compiled executable produced an error message when attempting to decompress
and untar the file:

tar xf /usr/portage/distfiles/kbd-1.15.5.tar.gz 
tar: Skipping to next header 
tar: Exiting with failure status due to previous errors

After a bit of trial and error I found if I changed the CFLAGS from:
1) CFLAGS = "-fomit-frame-pointer -pipe -march=native -mtune=native
-fexcess-precision=fast -O3"
to:
2) CFLAGS="-march=native -mtune=native -O2 -pipe -fomit-frame-pointer
-fexcess-precision=fast"
then the code would work as designed.

This is a 64 bit system with abi_32 enabled, but I don't think that makes any
difference in this case.

Steps to reproduce: using gcc 4.8.3 compile the attached tar, the run the
executable to extract the attached kbd. It will fail with the error message
above.

Change to -O2 and it will work fine.


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

* [Bug c/64941] -O3 breaks tar
  2015-02-05  5:22 [Bug c/64941] New: -O3 breaks tar brian at soulspark dot org
@ 2015-02-05  5:28 ` brian at soulspark dot org
  2015-02-05  5:37 ` [Bug target/64941] " pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: brian at soulspark dot org @ 2015-02-05  5:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Brian M <brian at soulspark dot org> ---
I can't attach the source so here are links to where they can be found:

tar: http://ftp.gnu.org/gnu/tar/tar-1.27.1.tar.bz2

kbd: https://www.kernel.org/pub/linux/utils/kbd/kbd-1.15.5.tar.gz


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

* [Bug target/64941] -O3 breaks tar
  2015-02-05  5:22 [Bug c/64941] New: -O3 breaks tar brian at soulspark dot org
  2015-02-05  5:28 ` [Bug c/64941] " brian at soulspark dot org
@ 2015-02-05  5:37 ` pinskia at gcc dot gnu.org
  2015-02-05 12:40 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-02-05  5:37 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
          Component|c                           |target
           Severity|major                       |normal


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

* [Bug target/64941] -O3 breaks tar
  2015-02-05  5:22 [Bug c/64941] New: -O3 breaks tar brian at soulspark dot org
  2015-02-05  5:28 ` [Bug c/64941] " brian at soulspark dot org
  2015-02-05  5:37 ` [Bug target/64941] " pinskia at gcc dot gnu.org
@ 2015-02-05 12:40 ` jakub at gcc dot gnu.org
  2015-02-09  1:55 ` brian at soulspark dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-05 12:40 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
First of all, -march=native and/or -mtune=native depends on the CPU you have,
so it is very hard to reproduce without the same CPU.  So, you should print
what -march=native -mtune=native means for you, e.g. by adding -v to CFLAGS and
pasting here the cc1 or cc1plus command line.
Then, you could try to bisect it among the -O3 vs. -O2 *.o files, always take
some -O3 and some -O2 files and find out the problematic one, attach
preprocessed source for that one (others might have different version of glibc
and its headers etc.).


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

* [Bug target/64941] -O3 breaks tar
  2015-02-05  5:22 [Bug c/64941] New: -O3 breaks tar brian at soulspark dot org
                   ` (2 preceding siblings ...)
  2015-02-05 12:40 ` jakub at gcc dot gnu.org
@ 2015-02-09  1:55 ` brian at soulspark dot org
  2015-02-14 18:16 ` mikpelinux at gmail dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: brian at soulspark dot org @ 2015-02-09  1:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Brian M <brian at soulspark dot org> ---
I tried sussing the flags for my march and mtune native, but didn't have any
luck (sorry, I'm mostly hardware, not software).

The best I can do is tell you what processor I'm running:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 60
model name      : Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz


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

* [Bug target/64941] -O3 breaks tar
  2015-02-05  5:22 [Bug c/64941] New: -O3 breaks tar brian at soulspark dot org
                   ` (3 preceding siblings ...)
  2015-02-09  1:55 ` brian at soulspark dot org
@ 2015-02-14 18:16 ` mikpelinux at gmail dot com
  2015-02-14 19:58 ` brian at soulspark dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mikpelinux at gmail dot com @ 2015-02-14 18:16 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Pettersson <mikpelinux at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpelinux at gmail dot com

--- Comment #4 from Mikael Pettersson <mikpelinux at gmail dot com> ---
I can't reproduce on Ivy Bridge, but the OP's machine is Haswell so
-march=native -mtune=native may cause different behaviour there.  Could someone
try this on Haswell?


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

* [Bug target/64941] -O3 breaks tar
  2015-02-05  5:22 [Bug c/64941] New: -O3 breaks tar brian at soulspark dot org
                   ` (4 preceding siblings ...)
  2015-02-14 18:16 ` mikpelinux at gmail dot com
@ 2015-02-14 19:58 ` brian at soulspark dot org
  2015-02-15  1:21 ` hjl.tools at gmail dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: brian at soulspark dot org @ 2015-02-14 19:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Brian M <brian at soulspark dot org> ---
I can give someone a KDE desktop to the actual machine to reproduce the failure
if you like.


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

* [Bug target/64941] -O3 breaks tar
  2015-02-05  5:22 [Bug c/64941] New: -O3 breaks tar brian at soulspark dot org
                   ` (5 preceding siblings ...)
  2015-02-14 19:58 ` brian at soulspark dot org
@ 2015-02-15  1:21 ` hjl.tools at gmail dot com
  2015-02-15  4:16 ` hjl.tools at gmail dot com
  2015-02-15 14:06 ` hjl.tools at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2015-02-15  1:21 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-02-15
                 CC|                            |areg.melikadamyan at gmail dot com
     Ever confirmed|0                           |1

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
Reproduced on Fedora/20 Haswell with gcc-4.8.3-7.fc20.x86_64


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

* [Bug target/64941] -O3 breaks tar
  2015-02-05  5:22 [Bug c/64941] New: -O3 breaks tar brian at soulspark dot org
                   ` (6 preceding siblings ...)
  2015-02-15  1:21 ` hjl.tools at gmail dot com
@ 2015-02-15  4:16 ` hjl.tools at gmail dot com
  2015-02-15 14:06 ` hjl.tools at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2015-02-15  4:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
GCC 4.9.3 20150215 is OK.


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

* [Bug target/64941] -O3 breaks tar
  2015-02-05  5:22 [Bug c/64941] New: -O3 breaks tar brian at soulspark dot org
                   ` (7 preceding siblings ...)
  2015-02-15  4:16 ` hjl.tools at gmail dot com
@ 2015-02-15 14:06 ` hjl.tools at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2015-02-15 14:06 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
A dup

*** This bug has been marked as a duplicate of bug 53623 ***


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

end of thread, other threads:[~2015-02-15 14:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-05  5:22 [Bug c/64941] New: -O3 breaks tar brian at soulspark dot org
2015-02-05  5:28 ` [Bug c/64941] " brian at soulspark dot org
2015-02-05  5:37 ` [Bug target/64941] " pinskia at gcc dot gnu.org
2015-02-05 12:40 ` jakub at gcc dot gnu.org
2015-02-09  1:55 ` brian at soulspark dot org
2015-02-14 18:16 ` mikpelinux at gmail dot com
2015-02-14 19:58 ` brian at soulspark dot org
2015-02-15  1:21 ` hjl.tools at gmail dot com
2015-02-15  4:16 ` hjl.tools at gmail dot com
2015-02-15 14:06 ` hjl.tools at gmail 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).