This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [patch] Separate {OS,CPU}_CPP_BUILTINS macros into C-family and language-independent macros


 

> -----Original Message-----
> From: FX [mailto:fxcoudert@gmail.com] 
> Sent: Wednesday, November 03, 2010 3:27 PM
> To: gcc-patches@gcc.gnu.org; gfortran List
> Cc: Michael Meissner; Rainer Orth; chertykov@gmail.com; 
> aesok@post.ru; Weddington, Eric
> Subject: [patch] Separate {OS,CPU}_CPP_BUILTINS macros into 
> C-family and language-independent macros
> 
> See below for the description of the patch; this take n+1 
> incorporates suggestions by Michael Meissner and Rainer Orth, 
> with the following exceptions:
> 
>   -- As avr.c includes new headers (cpplib.h and 
> cppbuiltin.h), I wanted to update its dependencies in the 
> target configuration file (t-avr), but to my surprise, this 
> file doesn't contain any mention of avr.o. In fact, I failed 
> to find any by grepping the whole tree, so I'm a little 
> unsure how this can work (and apparently it does). Could the 
> maintainers help me here?

Hmm. AFAICT, in looking through the history of that file, the first time that it contained any dependency information was June 23, 2009 (revision 148868) and it wasn't for avr.o. I don't think it ever contained dependency information for avr.o. 


 
> The attached patch fixes PR 42954: when Fortran moved to 
> using libcpp directly from the front-end (instead of calling 
> cc1 to do its preprocessing), we lost all target-specific CPP 
> built-in macros. The issue is that part of the code in 
> TARGET_OS_CPP_BUILTINS and TARGET_CPU_CPP_BUILTINS depends on 
> C-only flags, and thus cannot be moved to a directory outside 
> gcc/c-family/.
> 
> The patch moves this C-only code to specific 
> TARGET_OS_CPP_BUILTINS_CFAMILY and 
> TARGET_CPU_CPP_BUILTINS_CFAMILY macros. I manually audited 
> all the targets in config/ twice, to check that I did not 
> leave any code behind. I have bootstrapped and regtested an 
> all-language compiler on x86_64-linux and i686-darwin. I have 
> also built C and Fortran cross-compilers (make all-gcc && 
> make fortran) for the following targets (which cover all 
> gcc/config/ files changed):
> 
> avr-elf
<snip>
> 
> In all cases, the cross-compiler built successfully and 
> seemed to work. In each case, I checked a few of the 
> target-specific macros (but did not check all of them).

That's news to me: I didn't know that you could now build the Fortran compiler for the AVR. (Not that anyone would seriously use it, but.. you never know.) Last I heard, the Fortran FE couldn't be built for the AVR because that port only has 32-bit doubles. See gcc bug #34040.

Thanks for doing this work. :-)

Eric Weddington


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]