public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Uros Bizjak <ubizjak@gmail.com>
Subject: Re: [PATCH] Don't build 32-bit libgomp with -march=i486 on x86-64
Date: Mon, 25 Apr 2016 10:03:00 -0000	[thread overview]
Message-ID: <20160425100330.GI26501@tucnak.zalov.cz> (raw)
In-Reply-To: <CAMe9rOre27+YkLpkLNfdW2Vzr_JEgN-rsxX-cHL=btUBAyx0xQ@mail.gmail.com>

On Wed, Apr 20, 2016 at 07:56:16AM -0700, H.J. Lu wrote:
> On Wed, Apr 20, 2016 at 7:53 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> > On Wed, Apr 20, 2016 at 07:43:27AM -0700, H.J. Lu wrote:
> >> From 12c6ddcf67593ed7137764ca74043f1a9c2d8fda Mon Sep 17 00:00:00 2001
> >> From: "H.J. Lu" <hjl.tools@gmail.com>
> >> Date: Wed, 30 Mar 2016 05:56:08 -0700
> >> Subject: [PATCH 2/3] Don't build 32-bit libgomp with -march=i486 on x86-64
> >>
> >> Gcc uses the same -march= for both -m32 and -m64 on x86-64 unless
> >> --with-arch-32= is used.  There is no need for -march=i486 to compile
> >> 32-bit libgomp on x86-64.
> >>
> >>       PR target/70454
> >>       * configure.tgt (XCFLAGS): Don't add -march=i486 to compile
> >>       32-bit target library on x86-64.
> >
> > That is wrong.  It could be --with-arch-32=i386 build.
> 
> libgomp/configure.tgt has
> 
>    # Note that bare i386 is not included here.  We need cmpxchg.
>     i[456]86-*-linux*)
> config_path="linux/x86 linux posix"
> case " ${CC} ${CFLAGS} " in
>  *" -m64 "*|*" -mx32 "*)
>    ;;
>  *)
>    if test -z "$with_arch"; then
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> --with-arch overrides everything.  I just follow the same practice.
> 
>      XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
>    fi
> esac
> ;;

Yes, and even the -m32 practice is not good.
We should do a preprocessor and/or compile time test in each of these cases
to find out if the default needs to be tweaked and tweak only in that case.

	Jakub

  reply	other threads:[~2016-04-25 10:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 15:08 H.J. Lu
2016-04-20 14:43 ` H.J. Lu
2016-04-20 14:53   ` Jakub Jelinek
2016-04-20 14:56     ` H.J. Lu
2016-04-25 10:03       ` Jakub Jelinek [this message]
2016-04-20 15:16     ` H.J. Lu

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=20160425100330.GI26501@tucnak.zalov.cz \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=ubizjak@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).