public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Trevor Saunders <tbsaunde@tbsaunde.org>
To: Kyrill Tkachov <kyrylo.tkachov@arm.com>
Cc: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>,
	Richard Biener <richard.guenther@gmail.com>,
	James Greenhalgh <James.Greenhalgh@arm.com>,
	"tbsaunde+gcc@tbsaunde.org" <tbsaunde+gcc@tbsaunde.org>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>,
	"nickc@redhat.com" <nickc@redhat.com>,
	Bin Cheng <Bin.Cheng@arm.com>,
	Bernd Schmidt <bernds@codesourcery.com>
Subject: Re: [PATCH 02/12] remove some ifdef HAVE_cc0
Date: Thu, 23 Apr 2015 12:01:00 -0000	[thread overview]
Message-ID: <20150423120141.GB2949@tsaunders-iceball.corp.tor1.mozilla.com> (raw)
In-Reply-To: <5538C23E.50003@arm.com>

On Thu, Apr 23, 2015 at 10:58:22AM +0100, Kyrill Tkachov wrote:
> 
> On 23/04/15 10:08, Richard Earnshaw wrote:
> >On 23/04/15 09:41, Kyrill Tkachov wrote:
> >>On 23/04/15 09:35, Richard Biener wrote:
> >>>On Thu, Apr 23, 2015 at 6:54 AM, Trevor Saunders <tbsaunde@tbsaunde.org> wrote:
> >>>>On Thu, Apr 23, 2015 at 04:27:59AM +0100, James Greenhalgh wrote:
> >>>>>On Tue, Apr 21, 2015 at 04:24:44PM +0100, Trevor Saunders wrote:
> >>>>>>On Tue, Apr 21, 2015 at 04:14:01PM +0200, Richard Biener wrote:
> >>>>>>>On Tue, Apr 21, 2015 at 3:24 PM,  <tbsaunde+gcc@tbsaunde.org> wrote:
> >>>>>>>>From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
> >>>>>>>>
> >>>>>>>>gcc/ChangeLog:
> >>>>>>>>
> >>>>>>>>2015-04-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
> >>>>>>>>
> >>>>>>>>          * conditions.h: Define macros even if HAVE_cc0 is undefined.
> >>>>>>>>          * emit-rtl.c: Define functions even if HAVE_cc0 is undefined.
> >>>>>>>>          * final.c: Likewise.
> >>>>>>>>          * jump.c: Likewise.
> >>>>>>>>          * recog.c: Likewise.
> >>>>>>>>          * recog.h: Declare functions even when HAVE_cc0 is undefined.
> >>>>>>>>          * sched-deps.c (sched_analyze_2): Always compile case for cc0.
> >>>>>If I've counted right after the git bisect, this patch seems to break
> >>>>>the ARM buildi (arm-none-linux-gnueabihf):
> >>>>>
> >>>>>    In file included from insn-output.c:40:0:
> >>>>>    ..../gcc-src/gcc/conditions.h:112:0: error: "CC_STATUS_INIT" redefined [-Werror]
> >>>>>     #define CC_STATUS_INIT  \
> >>This is a warning-to-error from -Werror, so this came out during bootstrap
> >>rather than a cross-build, right?
> >>
> >>
> >>>>>     ^
> >>>>>    In file included from tm.h:35:0,
> >>>>>                     from insn-output.c:7:
> >>>>>    ..../gcc-src/gcc/config/arm/arm.h:2159:0: note: this is the location of the previous definition
> >>>>>     #define CC_STATUS_INIT \
> >>>>>     ^
> >>>>>
> >>>>>I guess the conditions.h definition wants wrapping in #ifndef - though a
> >>>>>quick grep suggests that ARM is the only target defining CC_STATUS_INIT
> >>>>>so lets CC the ARM maintainers and see what their preference is...
> >>>>Well, that seems pretty weird, but it looks intentional arm does this
> >>>>see http://gcc.gnu.org/ml/gcc-patches/2010-07/msg00437.html
> >>>>
> >>>>Of course I now see final.c also defines a fall back, so maybe the right
> >>>>thing to do is wrap the conditions.h definition in #if HAVE_cc0, or
> >>>>maybe the final.c definition can go away? Right now I'm to tired to make
> >>>>a good decision about that.
> >>>>
> >>>>sorry about the bustage!
> >>>Looks like the best thing is to turn this into a target hook then?  Or move the
> >>>fallback/default to defaults.h

Given the macro has multiple definitions I guess ultimately it should
move to a target hook unless someone decides to rework the arm backend.
Till then the ifdef in conditions.h doesn't seem to bad (I may well work
on converting a bunch of stuff to target hooks in the somewhat near
future).

> >>Shall we revert this patch for now then to restore bootstrap?
> >>
> >Isn't the most constructive temporary fix to just wrap the definition in
> >conditions.h with #ifndef CC_STATUS_INIT?
> 
> Like this?
> Ok for trunk as a temporary fix?

sgtm, thanks!

Trev

> 
> Thanks,
> Kyrill
> 
> 2015-04-23  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
> 
>     * conditions.h (CC_STATUS_INIT): Gate on #ifndef CC_STATUS_INIT.
> >R.
> >
> >>Kyrill
> >>
> >>>Richard.
> >>>
> >>>>Trev
> >>>>
> >>>>
> >>>>>Thanks,
> >>>>>James
> 

> diff --git a/gcc/conditions.h b/gcc/conditions.h
> index 7cd1e1c..0bda9a4 100644
> --- a/gcc/conditions.h
> +++ b/gcc/conditions.h
> @@ -109,8 +109,10 @@ extern CC_STATUS cc_status;
>  /* This is how to initialize the variable cc_status.
>     final does this at appropriate moments.  */
>  
> +/* FIXME: We want to get rid of these ifndefs.  */
> +#ifndef CC_STATUS_INIT
>  #define CC_STATUS_INIT  \
>   (cc_status.flags = 0, cc_status.value1 = 0, cc_status.value2 = 0,  \
>    CC_STATUS_MDEP_INIT)
> -
> +#endif
>  #endif /* GCC_CONDITIONS_H */

  parent reply	other threads:[~2015-04-23 12:01 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 13:25 [PATCH 00/12] Reduce conditional compilation tbsaunde+gcc
2015-04-21 13:25 ` [PATCH 05/12] make some HAVE_cc0 code always compiled tbsaunde+gcc
2015-04-21 13:54   ` Jeff Law
2015-04-21 13:25 ` [PATCH 10/12] remove more ifdefs for HAVE_cc0 tbsaunde+gcc
2015-04-21 13:55   ` Jeff Law
2015-04-21 13:25 ` [PATCH 08/12] reduce conditional compilation for HARD_FRAME_POINTER_IS_FRAME_POINTER tbsaunde+gcc
2015-04-21 13:37   ` Jeff Law
2015-04-21 13:25 ` [PATCH 02/12] remove some ifdef HAVE_cc0 tbsaunde+gcc
2015-04-21 13:48   ` Jeff Law
2015-04-21 14:14   ` Richard Biener
2015-04-21 15:24     ` Trevor Saunders
2015-04-23  3:28       ` James Greenhalgh
2015-04-23  4:55         ` Trevor Saunders
2015-04-23  8:35           ` Richard Biener
2015-04-23  8:41             ` Kyrill Tkachov
2015-04-23  9:08               ` Richard Earnshaw
2015-04-23  9:58                 ` Kyrill Tkachov
2015-04-23 10:30                   ` Richard Biener
2015-04-23 12:01                   ` Trevor Saunders [this message]
2015-04-21 13:25 ` [PATCH 09/12] remove #if for PIC_OFFSET_TABLE_REGNUM tbsaunde+gcc
2015-04-21 13:34   ` Jeff Law
2015-04-21 13:25 ` [PATCH 07/12] provide default for MASK_RETURN_ADDR tbsaunde+gcc
2015-04-21 13:32   ` Jeff Law
2015-04-21 13:25 ` [PATCH 12/12] add default for INSN_REFERENCES_ARE_DELAYED tbsaunde+gcc
2015-04-21 13:30   ` Jeff Law
2015-04-21 13:25 ` [PATCH 06/12] provide default for RETURN_ADDR_OFFSET tbsaunde+gcc
2015-04-21 13:32   ` Jeff Law
2015-04-21 13:25 ` [PATCH 01/12] add default definition of EH_RETURN_DATA_REGNO tbsaunde+gcc
2015-04-21 13:40   ` Jeff Law
2015-04-21 14:00     ` Jakub Jelinek
2015-04-21 14:04       ` Jeff Law
2015-04-21 13:25 ` [PATCH 03/12] more removal of ifdef HAVE_cc0 tbsaunde+gcc
2015-04-21 13:51   ` Jeff Law
2015-04-21 15:24     ` Trevor Saunders
2015-04-21 13:25 ` [PATCH 04/12] always define HAVE_cc0 tbsaunde+gcc
2015-04-21 13:53   ` Jeff Law
2015-04-21 15:18     ` Trevor Saunders
2015-04-21 13:25 ` [PATCH 11/12] provide default for INSN_SETS_ARE_DELAYED tbsaunde+gcc
2015-04-21 13:31   ` Jeff Law
2015-04-21 13:43 ` [PATCH 00/12] Reduce conditional compilation Jeff Law
2015-04-21 13:57 ` Jeff Law
2015-04-21 15:29   ` Trevor Saunders
2015-04-22 18:19     ` David Malcolm
2015-04-22 18:37       ` Jeff Law
2015-04-22 20:46         ` Trevor Saunders
2015-04-22 20:47           ` Jeff Law

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=20150423120141.GB2949@tsaunders-iceball.corp.tor1.mozilla.com \
    --to=tbsaunde@tbsaunde.org \
    --cc=Bin.Cheng@arm.com \
    --cc=James.Greenhalgh@arm.com \
    --cc=Ramana.Radhakrishnan@arm.com \
    --cc=Richard.Earnshaw@foss.arm.com \
    --cc=bernds@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kyrylo.tkachov@arm.com \
    --cc=nickc@redhat.com \
    --cc=richard.guenther@gmail.com \
    --cc=tbsaunde+gcc@tbsaunde.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).