public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Wouter Verhelst <wouter@debian.org>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Debian m68k <debian-68k@lists.debian.org>,
	Linux/m68k <linux-m68k@vger.kernel.org>
Subject: Re: gcc possibly generating invalid assembler
Date: Wed, 19 Apr 2017 09:39:38 +0200	[thread overview]
Message-ID: <20170419073938.235okxaw2e4rw3ev@grep.be> (raw)
In-Reply-To: <cf267478-6b32-a822-c01d-2b6bfbe2f98f@physik.fu-berlin.de>

On Tue, Apr 18, 2017 at 08:42:32PM +0200, John Paul Adrian Glaubitz wrote:
> On 04/14/2017 09:36 AM, Wouter Verhelst wrote:
> > Then I ran 'make CFLAGS=-save-temps' to see whether it perhaps did add
> > some inline assembly somewhere but you missed the #include and this time
> > it... worked?
> 
> Actually, adding -save-temps to CFLAGS doesn't help. However, since you
> wrote "CFLAGS=-save-temps" instead of "CFLAGS+=-save-temps", I assume
> you overrode the optimization level which has influence on the code
> generation.

Good point, but nope, even with 'CFLAGS+=-save-temps' it succeeds.

Next attempt, "make V=1" returns the following command line:

m68k-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -I../../urcu -I../..  -I../.. -I../../tests/common -g -g -O2 -pthread -MT test_urcu_defer.o -MD -MP -MF .deps/test_urcu_defer.Tpo -c -o test_urcu_defer.o test_urcu_defer.c 

when I add CFLAGS=-save-temps (or CFLAGS+=, it makes not difference), it
turns out that the bit "-g -O2 -pthread" is dropped; it may be either
due to lack of pthread support, or the optimization level. Feels like
someone failed to read the automake documentation properly (CFLAGS is
supposed to remain unset; and indeed checking out configure.ac reveals
some CFLAGS munging that shouldn't happen).

Anyway, that means the most likely cause is the optimizer.

-- 
< ron> I mean, the main *practical* problem with C++, is there's like a dozen
       people in the world who think they really understand all of its rules,
       and pretty much all of them are just lying to themselves too.
 -- #debian-devel, OFTC, 2016-02-12

  reply	other threads:[~2017-04-19  7:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-13 11:08 gcc possibly generating invalid assembler John Paul Adrian Glaubitz
2017-04-14  7:36 ` Wouter Verhelst
2017-04-18 18:42   ` John Paul Adrian Glaubitz
2017-04-19  7:39     ` Wouter Verhelst [this message]
2017-04-19  7:46       ` John Paul Adrian Glaubitz
2017-04-19  7:51       ` Wouter Verhelst
2017-04-19  8:38       ` Wouter Verhelst
2017-04-17 20:01 ` Richard Z
  -- strict thread matches above, loose matches on Subject: below --
2017-04-20 21:00 Michael Jeanson
2017-04-20 21:43 ` Wouter Verhelst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170419073938.235okxaw2e4rw3ev@grep.be \
    --to=wouter@debian.org \
    --cc=debian-68k@lists.debian.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-m68k@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox