[PATCH 0/6] Thread pointer built-in functions

2012-07-12 Thread Chung-Lin Tang
Hi, following discussion here: http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00229.html (and a few other mails in the thread between Richard Sandiford) A number of targets implement the same name __builtin_thread_pointer(), __builtin_set_thread_pointer() TLS builtins. This set of patches changes

[PATCH 1/6] Thread pointer built-in functions, core parts

2012-07-12 Thread Chung-Lin Tang
Core parts adding the new hooks. BUILT_IN_THREAD_POINTER and BUILT_IN_SET_THREAD_POINTER are different hooks, as some targets only implement one of them (thread pointer read). Thanks, Chung-Lin * targhooks.c (default_expand_builtin_thread_pointer): New.

[PATCH 2/6] Thread pointer built-in functions, alpha

2012-07-12 Thread Chung-Lin Tang
Alpha parts. Note that now the machine-independent __builtin_thread_pointer() is now marked as const/readonly, slightly different from the original alpha backend code. Thanks, Chung-Lin * config/alpha/alpha.c (alpha_builtin): Remove ALPHA_BUILTIN_THREAD_POINTER,

[PATCH 3/6] Thread pointer built-in functions, arm

2012-07-12 Thread Chung-Lin Tang
ARM parts, no further notes. Thanks, Chung-Lin * config/arm/arm.c (arm_builtins): Remove ARM_BUILTIN_THREAD_POINTER. (arm_init_tls_builtins): Remove function. (arm_init_builtins): Remove call to arm_init_tls_builtins(). (arm_expand_builtin): Remove

[PATCH 4/6] Thread pointer built-in functions, s390

2012-07-12 Thread Chung-Lin Tang
S390 parts. In this patch, because the thread-pointer builtins were the only machine-dependent builtins in the s390 backend, I have removed basically all the init/expand builtin hook code. If the s390 maintainers want to keep the code for possible future backend builtins, this patch might need to

[PATCH 5/6] Thread pointer built-in functions, xtensa

2012-07-12 Thread Chung-Lin Tang
xtensa parts. No other notes. Thanks, Chung-Lin * config/xtensa/xtensa.c (xtensa_expand_builtin_thread_pointer): Add hook function for TARGET_EXPAND_BUILTIN_THREAD_POINTER. (xtensa_expand_builtin_set_thread_pointer): Add hook function for

[PATCH 6/6] Thread pointer built-in functions, mips

2012-07-12 Thread Chung-Lin Tang
Finally, what I personally need, the MIPS parts. Thanks, Chung-Lin * config/mips/mips.c (mips_get_tp): Add 'target' parameter for generating to specific reg. (mips_legitimize_tls_address): Update calls to mips_get_tp(). (mips_expand_builtin_thread_pointer): Add

Re: [patch] Call free_after_parsing earlier

2012-07-12 Thread Richard Guenther
On Wed, Jul 11, 2012 at 9:39 PM, Steven Bosscher stevenb@gmail.com wrote: Hello, GCC calls free_after_parsing in rest_of_clean_state. That's way too late, it can be done in free_lang_data_in_cgraph instead. But that's only called with -flto ... I think it should be called in

Re: PR 51094 - fprint_w() in output_addr_const() reinstated

2012-07-12 Thread Andreas Schwab
Dimitrios Apostolou ji...@gmx.net writes: @@ -3849,6 +3850,32 @@ sprint_ul_rev (char *s, unsigned long va return i; } +/* Write a signed HOST_WIDE_INT as decimal to a file, fast. */ + +void +fprint_w (FILE *f, HOST_WIDE_INT value) +{ + /* python says: len(str(2**64)) == 20 */ +

Re: new sign/zero extension elimination pass

2012-07-12 Thread Tom de Vries
Kenneth, I see I replied to your original message that had the wrong CC, I'm now CC-ing gcc-patches@gcc.gnu.org. Thanks, - Tom On 12/07/12 11:05, Tom de Vries wrote: On 12/07/12 03:39, Kenneth Zadeck wrote: Tom, I have a problem with the approach that you have taken here. I believe that

Re: [patch][fortran] Include coretypes.h in .c files, not in gfortran.h

2012-07-12 Thread Tobias Burnus
On 07/07/2012 11:28 PM, Steven Bosscher wrote: I must say, I am surprised that gfortran.h includes coretypes.h. The idea always was to try and keep the front end and the back end as much separated as possible, and including coretypes.h in the most important front-end header doesn't fit in that

Re: [PATCH 3/6] Thread pointer built-in functions, arm

2012-07-12 Thread Ramana Radhakrishnan
On 12 July 2012 07:52, Chung-Lin Tang clt...@codesourcery.com wrote: ARM parts, no further notes. ARM parts are ok, modulo approval for generic parts and no regressions with testing on arm-linux-gnueabi. Thanks, Ramana Thanks, Chung-Lin * config/arm/arm.c (arm_builtins): Remove

Re: [Patch, Fortran] Handle C_F_POINTER with a noncontiguous SHAPE=

2012-07-12 Thread Tobias Burnus
*ping* On 06/28/2012 09:34 AM, Tobias Burnus wrote: This patch generates inline code for C_F_POINTER with an array argument. One reason is that GCC didn't handle SHAPE= arguments which were noncontiguous. Actually, I just messed up my test case and didn't properly read the

[Ada] Report unhandled exceptions as unhandled

2012-07-12 Thread Arnaud Charlet
On some targets, there is a catch-all handler to catch unhandled exceptions. This patch adjust the personality routine to report them as unhandled. Behavior not changed. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-12 Tristan Gingold ging...@adacore.com * raise-gcc.c: Do

[Ada] Move GNAT.Byte_Swapping to System

2012-07-12 Thread Arnaud Charlet
This change moves the GNAT runtime package GNAT.Byte_Swapping under System (with a renaming under GNAT for compatibility) so that the unit can be used from expanded code at a later point. No visible behaviour change (simple code reorganization), no test. Tested on x86_64-pc-linux-gnu, committed

[Ada] Increase alternate stack size on hpux

2012-07-12 Thread Arnaud Charlet
To meet MINSIGSTKSZ requirement. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-12 Tristan Gingold ging...@adacore.com * s-osinte-hpux.ads: Increase alternate stack size on hpux. Index: s-osinte-hpux.ads ===

[Ada] gnatmake --subdirs without project file, binding and linking

2012-07-12 Thread Arnaud Charlet
When gnatmake is invoked with --subdirs=, but without -P, the binder generated files and the executable are put by default in the specified subdirectory. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-12 Vincent Celier cel...@adacore.com * make.adb (Binding_Phase): If

[Ada] Allow the same library project in different project tree

2012-07-12 Thread Arnaud Charlet
It is possible to have the same library project in different aggregated projects, so in different project tree. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-12 Pascal Obry o...@adacore.com * prj-nmsc.adb (Check_Library_Attributes): Allow the same library project

[Ada] Fix dependency problems from System.Restrictions

2012-07-12 Thread Arnaud Charlet
This patch completely changes the way restrictions information is generated in the ALI file. Instead of using a positional notation that is sensitive to the addition of new restrictions, it uses a named notation, that avoids this dependency. If a new restriction is added, and an incompatible

[Ada] Add VMS qualifiers for -gnatn1/2 switches.

2012-07-12 Thread Arnaud Charlet
Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-12 Vasiliy Fofanov fofa...@adacore.com * vms_data.ads: Add VMS qualifiers for -gnatn1/2 switches. Index: vms_data.ads === --- vms_data.ads(revision 189431)

Re: new sign/zero extension elimination pass

2012-07-12 Thread Kenneth Zadeck
sorry about the two messages. i mis spelled the gcc-patches on the first try. you are on the right track with the example but combine will not get this unless everything is in the same bb. the whole point of having a separate pass for doing extension elimination is that it needs to be done

Re: [patch][fortran] Include coretypes.h in .c files, not in gfortran.h

2012-07-12 Thread Steven Bosscher
On Thu, Jul 12, 2012 at 11:29 AM, Tobias Burnus bur...@net-b.de wrote: On 07/07/2012 11:28 PM, Steven Bosscher wrote: I must say, I am surprised that gfortran.h includes coretypes.h. The idea always was to try and keep the front end and the back end as much separated as possible, and

[patch] Fix tree-ssa-reassoc to not look at first_pass_instance

2012-07-12 Thread Steven Bosscher
Hello, The global variable first_pass_instance exists to hack jump threading, see tree-pass.h: /* Set to true if the pass is called the first time during compilation of the current function. Note that using this information in the optimization passes is considered not to be clean, and it

Re: [patch] Fix tree-ssa-reassoc to not look at first_pass_instance

2012-07-12 Thread Richard Guenther
On Thu, Jul 12, 2012 at 2:24 PM, Steven Bosscher stevenb@gmail.com wrote: Hello, The global variable first_pass_instance exists to hack jump threading, see tree-pass.h: /* Set to true if the pass is called the first time during compilation of the current function. Note that using

Re: [PATCH] [LM32] Fix lm32-elf-gcc build error by remove unnecessary constant legitimate check.

2012-07-12 Thread Jia Liu
Hi Hans, On Thu, Jul 12, 2012 at 10:04 AM, Hans-Peter Nilsson h...@bitrange.com wrote: On Tue, 10 Jul 2012, Jia Liu wrote: Hi all, When I build lm32-elf-gcc, it failed at libgcc configure due to lm32-elf-cc1 segment fault when compile conftest.c: void bar (); void clean (int *); void foo

Re: [patch] Add block debug info to phi_arg_d

2012-07-12 Thread Uros Bizjak
Hello! A test is added. Is it ok? gcc/testsuite/ChangeLog 2012-07-08 Dehao Chen de...@google.com * gcc.dg/debug_info_inline.c: New test. This test fails on alphaev68-unknown-linux-gnu [1] and other non-x86 targets [2] too: FAIL: gcc.dg/debug_info_inline.c scan-assembler loc 1

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-12 Thread Jason Merrill
On 06/15/2012 04:27 PM, Paolo Carlini wrote: FAIL: g++.dg/template/access7.C -std=c++98 (test for errors, line 8) FAIL: g++.dg/template/access7.C -std=c++98 (test for errors, line 12) FAIL: g++.dg/template/access7.C -std=c++98 (test for warnings, line 17) FAIL: g++.dg/template/access7.C

Re: [patch] Fix tree-ssa-reassoc to not look at first_pass_instance

2012-07-12 Thread Steven Bosscher
On Thu, Jul 12, 2012 at 2:38 PM, Richard Guenther richard.guent...@gmail.com wrote: Richi, could you please have a look at jump threading, and see if first_pass_instance can be remove? Ping? :-) Bootstrappedtested on x86_64-unknown-linux-gnu. OK for trunk? This was proposed before and I

[PATCH, i386]: Cleanup cmove splitters

2012-07-12 Thread Uros Bizjak
Hello! 2012-07-12 Uros Bizjak ubiz...@gmail.com * config/i386/i386.md (QImode and HImode cmove splitters): Merge QImode and HImode splitters. Use ix86_comparison_operator. Explicitly match FLAGS_REG. (DFmode cmove splitter): Explicitly match FLAGS_REG. Tested

Re: [patch] Fix tree-ssa-reassoc to not look at first_pass_instance

2012-07-12 Thread Richard Günther
Steven Bosscher stevenb@gmail.com wrote: On Thu, Jul 12, 2012 at 2:38 PM, Richard Guenther richard.guent...@gmail.com wrote: Richi, could you please have a look at jump threading, and see if first_pass_instance can be remove? Ping? :-) Bootstrappedtested on x86_64-unknown-linux-gnu. OK

Re: [PATCH 1/6] Thread pointer built-in functions, core parts

2012-07-12 Thread Richard Sandiford
Hi Chung-Lin, Chung-Lin Tang clt...@codesourcery.com writes: Core parts adding the new hooks. BUILT_IN_THREAD_POINTER and BUILT_IN_SET_THREAD_POINTER are different hooks, as some targets only implement one of them (thread pointer read). Thanks a lot for doing this. It looks great to me,

Re: [Patch, Fortran] Handle C_F_POINTER with a noncontiguous SHAPE=

2012-07-12 Thread Mikael Morin
On 28/06/2012 09:34, Tobias Burnus wrote: This patch generates inline code for C_F_POINTER with an array argument. One reason is that GCC didn't handle SHAPE= arguments which were noncontiguous. However, the real motivation is the fortran-dev branch with the new array-descriptor:

Re: [PATCH 6/6] Thread pointer built-in functions, mips

2012-07-12 Thread Richard Sandiford
Chung-Lin Tang clt...@codesourcery.com writes: @@ -2851,11 +2851,12 @@ mips_call_tls_get_addr (rtx sym, enum mips_symbol_ /* Return a pseudo register that contains the current thread pointer. */ static rtx -mips_get_tp (void) +mips_get_tp (rtx target) { - rtx tp, fn; + rtx fn; +

Re: Fix PR53908

2012-07-12 Thread Richard Sandiford
Steven Bosscher stevenb@gmail.com writes: On Wed, Jul 11, 2012 at 1:24 PM, Bernd Schmidt ber...@codesourcery.com wrote We're moving a load across a call since we don't recognize calls as memory-clobbering. Bootstrapping and testing now on 4.7 x86_64-linux, ok everywhere? Maybe: +

Re: [PATCH] [LM32] Fix lm32-elf-gcc build error by remove unnecessary constant legitimate check.

2012-07-12 Thread Hans-Peter Nilsson
On Thu, 12 Jul 2012, Jia Liu wrote: May you give me more comment? I wanna fix it. Sorry, I'll leave that to the lm32 maintainer, I just wasnted to clear a misunderstanding regarding TARGET_LEGITIMATE_CONSTANT_P. brgds, H-P

Re: [Patch, Fortran] Add parsing support for assumed-rank array

2012-07-12 Thread Mikael Morin
On 06/07/2012 23:13, Tobias Burnus wrote: In case it's not, then everything is fine I guess, though I prefer avoiding polluting the scalarizer with assumed rank stuff ;-). It still will get worse, see above. Though, I wouldn't mind if you could modify the scalarizer. I don't see how I

Re: [Patch, Fortran] Add parsing support for assumed-rank array

2012-07-12 Thread Tobias Burnus
Mikael Morin wrote: I don't see how I could. The scalarizer's purpose is translating array statements like foo(:,:) = bar(:,:), where the rank at least is supposed known, so that we know how many nested loops we have to generate. If the number of loops is known at runtime only, hem, I don't

Re: Fix gcc.dg/lower-subreg-1.c failure, revisited.

2012-07-12 Thread Hans-Peter Nilsson
From: Hans-Peter Nilsson h...@axis.com Date: Sun, 8 Jul 2012 01:02:34 +0200 PR rtl-optimization/53176 * rtlanal.c (rtx_cost): Adjust default cost for X with a UNITS_PER_WORD factor for all X according to the size of its mode, not just for SUBREGs with untieable

Re: [Patch, Fortran] Handle C_F_POINTER with a noncontiguous SHAPE=

2012-07-12 Thread Tobias Burnus
Hi Mikael, dear all, Mikael Morin wrote: PPS: The offset handling in gfortran is really complicated. I wonder whether we have to (or at least should) change it for the new array descriptor. I don't know exactly what you mean by really complicated. There are not many simple things in gfortran

[patch] Add test for PR c++/53531

2012-07-12 Thread Jonathan Wakely
PR c++/53531 * testsuite/g++.dg/cpp0x/variadic135.C: New. As suggested in the PR comments this adds a test to ensure this doesn't regress. OK for trunk? commit 2fa33c6b4e5533b7d87ba559b43bb06e501e9851 Author: Jonathan Wakely jwakely@gmail.com Date: Thu Jul 12 23:37:40 2012

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-12 Thread Jason Merrill
And here's a fix for the access7 failure, to be applied on top of your patch. I notice that your patch changes the behavior of C++98/03 mode as well, which seems wrong to me; I think this is a big enough change that we should limit it to C++11 mode. Jason commit

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-12 Thread Jason Merrill
These patches fix the typedef11.C and friend13/15.C failures. Each fixes a latent bug in the compiler. 1) We shouldn't do access control checking for typedefs used in the body of a function when the declaration is instantiated; we should wait until the body is instantiated. 2) We shouldn't

Re: [PATCH 1/6] Thread pointer built-in functions, core parts

2012-07-12 Thread Mike Stump
On Jul 11, 2012, at 11:52 PM, Chung-Lin Tang wrote: Core parts adding the new hooks. BUILT_IN_THREAD_POINTER and BUILT_IN_SET_THREAD_POINTER are different hooks, as some targets only implement one of them (thread pointer read). sorry seems a little overly dramatic. I would have thought that

__int256

2012-07-12 Thread Mike Stump
This patch adds __int256 to the front-ends. We follow the __int128 code fairly closely... So, an outstanding question would be, how do I get the mangle codes allocated for the type? I just choose two unused codes, for now. All in all, the patch was pretty straight forward. We have another