Re: [Patch, Fortran] PR50640, PR51207 - fix select_type_12
Dear Tobias, > > The patch has been bootstrapped and regtested on x86-64-linux. > OK for the trunk? Absolutely OK! I though that you might even commit it as "obvious" since you, Janus and I discussed it :-) Cheers Paul
[v3] Fix bitset::operator[] const in debug/profile mode
Hi, noticed this while investigating the spurious failure of bitset/operations/constexpr.cc in debug-mode. Unfortunately debug-mode bitset checking is pretty weak in C++0x mode (for other reasons too), but at least now the operator is conforming and the testsuite is clean. Committed to mainline. Thanks, Paolo. / 2011-11-19 Paolo Carlini * include/debug/bitset (operator[](size_t) const): Declare constexpr. * include/profile/bitset: Likewise. * testsuite/23_containers/bitset/operations/constexpr.cc: Split out non portable bits to... * testsuite/23_containers/bitset/operations/constexpr-2.cc: ... here. Index: include/debug/bitset === --- include/debug/bitset(revision 181505) +++ include/debug/bitset(working copy) @@ -51,7 +51,7 @@ public: // In C++0x we rely on normal reference type to preserve the property // of bitset to be use as a literal. - // TODO: Find an other solution. + // TODO: Find another solution. #ifdef __GXX_EXPERIMENTAL_CXX0X__ typedef typename _Base::reference reference; #else @@ -272,11 +272,14 @@ // _GLIBCXX_RESOLVE_LIB_DEFECTS // 11. Bitset minor problems - bool + _GLIBCXX_CONSTEXPR bool operator[](size_t __pos) const { +#ifndef __GXX_EXPERIMENTAL_CXX0X__ + // TODO: Check in debug-mode too. __glibcxx_check_subscript(__pos); - return _M_base()[__pos]; +#endif + return _Base::operator[](__pos); } using _Base::to_ulong; Index: include/profile/bitset === --- include/profile/bitset (revision 181505) +++ include/profile/bitset (working copy) @@ -232,10 +232,10 @@ // _GLIBCXX_RESOLVE_LIB_DEFECTS // 11. Bitset minor problems - bool + _GLIBCXX_CONSTEXPR bool operator[](size_t __pos) const { - return _M_base()[__pos]; + return _Base::operator[](__pos); } using _Base::to_ulong; Index: testsuite/23_containers/bitset/operations/constexpr-2.cc === --- testsuite/23_containers/bitset/operations/constexpr-2.cc(revision 181505) +++ testsuite/23_containers/bitset/operations/constexpr-2.cc(working copy) @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-require-normal-mode "" } // { dg-options "-std=gnu++0x" } // Copyright (C) 2011 Free Software Foundation, Inc. @@ -31,10 +32,5 @@ auto r2 __attribute__((unused)) = base._M_getdata(); constexpr auto r3 __attribute__((unused)) = base._M_hiword(); - // bitset operators - typedef std::bitset<6> bitset_type; - constexpr bitset_type a = bitset_type(); - constexpr auto v __attribute__((unused)) = a[0]; - return 0; } Index: testsuite/23_containers/bitset/operations/constexpr.cc === --- testsuite/23_containers/bitset/operations/constexpr.cc (revision 181505) +++ testsuite/23_containers/bitset/operations/constexpr.cc (working copy) @@ -22,15 +22,6 @@ int main() { - // bitset base type - typedef std::_Base_bitset<6> bitset_base; - constexpr bitset_base base = bitset_base(); - - constexpr auto r1 __attribute__((unused)) = base._M_getword(2); - // constexpr auto r2 = base._M_getdata(); // error, pointer to this - auto r2 __attribute__((unused)) = base._M_getdata(); - constexpr auto r3 __attribute__((unused)) = base._M_hiword(); - // bitset operators typedef std::bitset<6> bitset_type; constexpr bitset_type a = bitset_type();
Re: [Patch] make it possible for the target to rename ".tm_clone_table"
On 18 Nov 2011, at 22:06, Joseph S. Myers wrote: TM_CLONE_TABLE_SECTION_NAME would better be a target hook, not a macro. ... done as below ... It should be possible for Rainer to define TARGET_ASM_TM_CLONE_TABLE_SECTION_NAME to NULL, and have varasm use the normal data section for tm_clone_table sections.One might wish to re-adjust testsuite/gcc.dg/tm/20100615.c if that is done. OK for trunk? Iain gcc: * target.def (tm_clone_table_section_name): New hook. * doc/tm.texi.in (TARGET_ASM_TM_CLONE_TABLE_SECTION_NAME): Define. * doc/tm.texi: Regenerate. * varasm.c (dump_tm_clone_pairs): Use target tm_clone_table_section_name if available, if that is NULL fall back to the data section. * config/darwin.h (TARGET_ASM_TM_CLONE_TABLE_SECTION_NAME): New. gcc/testsuite: * gcc.dg/tm/20100615.c: Adjust for Darwin tm_clone_table section name. Index: gcc/doc/tm.texi.in === --- gcc/doc/tm.texi.in (revision 181497) +++ gcc/doc/tm.texi.in (working copy) @@ -7013,6 +7013,8 @@ otherwise. @hook TARGET_ASM_MERGEABLE_RODATA_PREFIX +@hook TARGET_ASM_TM_CLONE_TABLE_SECTION_NAME + @hook TARGET_ASM_SELECT_RTX_SECTION Return the section into which a constant @var{x}, of mode @var{mode}, should be placed. You can assume that @var{x} is some kind of Index: gcc/target.def === --- gcc/target.def (revision 181497) +++ gcc/target.def (working copy) @@ -305,6 +305,16 @@ section names for mergeable constant data. Define the string if a different section name should be used.", const char *, ".rodata") +/* Set if the target wants to override the default ".tm_clone_table" + section name. */ +DEFHOOKPOD +(tm_clone_table_section_name, + "Define this macro to specify the section name that should be used\ + for transactional memory clone tables. If this is defined to NULL\ + the normal data section will be used for the tables instead.\ + The default section name is @code{\".tm_clone_table\"}.", + const char *, ".tm_clone_table") + /* Output a constructor for a symbol with a given priority. */ DEFHOOK (constructor, Index: gcc/testsuite/gcc.dg/tm/20100615.c === --- gcc/testsuite/gcc.dg/tm/20100615.c (revision 181497) +++ gcc/testsuite/gcc.dg/tm/20100615.c (working copy) @@ -3,7 +3,8 @@ /* Since the non TM version of new_node() gets optimized away, it shouldn't appear in the clone table either. */ -/* { dg-final { scan-assembler-not "tm_clone_table" } } */ +/* { dg-final { scan-assembler-not "tm_clone_table" { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler-not "__DATA,__tm_clone_table" { target *-*-darwin* } } } */ #define NULL 0 extern void *malloc (__SIZE_TYPE__); Index: gcc/varasm.c === --- gcc/varasm.c(revision 181497) +++ gcc/varasm.c(working copy) @@ -5961,7 +5961,13 @@ dump_tm_clone_pairs (VEC(tm_alias_pair,heap) *tm_a if (!switched) { - switch_to_section (get_named_section (NULL, ".tm_clone_table", 3)); + if (targetm.asm_out.tm_clone_table_section_name) + switch_to_section (get_named_section + (NULL, +targetm.asm_out.tm_clone_table_section_name, +3)); + else + switch_to_section (data_section); assemble_align (POINTER_SIZE); switched = true; } Index: gcc/config/darwin.h === --- gcc/config/darwin.h (revision 181497) +++ gcc/config/darwin.h (working copy) @@ -692,6 +692,10 @@ extern GTY(()) section * darwin_sections[NUM_DARWI #define TARGET_ASM_UNIQUE_SECTION darwin_unique_section #undef TARGET_ASM_FUNCTION_RODATA_SECTION #define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section + +#undef TARGET_ASM_TM_CLONE_TABLE_SECTION_NAME +#define TARGET_ASM_TM_CLONE_TABLE_SECTION_NAME "__DATA,__tm_clone_table" + #undef TARGET_ASM_RELOC_RW_MASK #define TARGET_ASM_RELOC_RW_MASK machopic_reloc_rw_mask
Re: [PATCH 0/2] Add atomic support to m68k
Richard Henderson writes: > The first patch adds support for the m68k-linux syscall. The second > patch adds native support for the m680[2346]0 CAS instruction, and > the m68000/Coldfire TAS instruction. > > Both tested only via cross-compile. > > Please test... Thanks Richard. I'm currently bootstrapping and regtesting this "natively" on aranym. /Mikael > > > r~ > > > Richard Henderson (2): > m68k-linux: Implement atomic operations via syscall. > m68k: Implement CAS and TAS patterns. > > gcc/config/m68k/linux.h |4 + > gcc/config/m68k/m68k.c|8 ++ > gcc/config/m68k/m68k.md |9 ++ > gcc/config/m68k/sync.md | 80 ++ > libgcc/config.host|6 +- > libgcc/config/m68k/linux-atomic.c | 211 > + > libgcc/config/m68k/t-linux|1 + > 7 files changed, 316 insertions(+), 3 deletions(-) > create mode 100644 gcc/config/m68k/sync.md > create mode 100644 libgcc/config/m68k/linux-atomic.c > create mode 100644 libgcc/config/m68k/t-linux > > -- > 1.7.4.4 >
[patch, ARM] Fix for PR50493 - ICE in neon_disambiguate_copy
This patch fixes PR50493. The code is designed to do the equivalent of a memmov operation, but on (consecutive) registers. After staring at the existing code for ages I still don't understand how it was supposed to work, but it is unnecessarily complex and clearly doesn't work properly in various cases. Anyway, the fix is fairly straight forward and doesn't need anything like as bad as an O(N^3) algorithm (even for small numbers of N). 2011-11-19 Richard Earnshaw PR target/50493 * arm.c (neon_disambiguate_copy): Correctly handle partial overlap of src and dest operands. *** arm.c (revision 181497) --- arm.c (local) *** neon_emit_pair_result_insn (enum machine *** 20728,20766 emit_move_insn (mem, tmp2); } ! /* Set up operands for a register copy from src to dest, taking care not to !clobber registers in the process. !FIXME: This has rather high polynomial complexity (O(n^3)?) but shouldn't !be called with a large N, so that should be OK. */ void neon_disambiguate_copy (rtx *operands, rtx *dest, rtx *src, unsigned int count) { ! unsigned int copied = 0, opctr = 0; ! unsigned int done = (1 << count) - 1; ! unsigned int i, j; ! while (copied != done) { for (i = 0; i < count; i++) ! { ! int good = 1; ! ! for (j = 0; good && j < count; j++) ! if (i != j && (copied & (1 << j)) == 0 ! && reg_overlap_mentioned_p (src[j], dest[i])) ! good = 0; ! ! if (good) ! { ! operands[opctr++] = dest[i]; ! operands[opctr++] = src[i]; ! copied |= 1 << i; ! } ! } } - - gcc_assert (opctr == count * 2); } /* Expand an expression EXP that calls a built-in function, --- 20728,20761 emit_move_insn (mem, tmp2); } ! /* Set up OPERANDS for a register copy from SRC to DEST, taking care !not to early-clobber SRC registers in the process. +We assume that the operands described by SRC and DEST represent a +decomposed copy of OPERANDS[1] into OPERANDS[0]. COUNT is the +number of components into which the copy has been decomposed. */ void neon_disambiguate_copy (rtx *operands, rtx *dest, rtx *src, unsigned int count) { ! unsigned int i; ! if (!reg_overlap_mentioned_p (operands[0], operands[1]) ! || REGNO (operands[0]) < REGNO (operands[1])) { for (i = 0; i < count; i++) ! { ! operands[2 * i] = dest[i]; ! operands[2 * i + 1] = src[i]; ! } ! } ! else ! { ! for (i = 0; i < count; i++) ! { ! operands[2 * i] = dest[count - i - 1]; ! operands[2 * i + 1] = src[count - i - 1]; ! } } } /* Expand an expression EXP that calls a built-in function,
[PATCH] PR c++/51194 - ICE with invalid alias template
Hello, Here we crash while looking up an instantiation of an erroneous member template. In the example of the patch below, when we look at the expression in #3, an error is (rightfully) triggered. As a result of 'bar' TT's argument (in #2) is foo, which takes 2 parameters. Then the partial instantiation of the member template 'mem' is ill-formed, as it is equivalent to: template<> template bar::P > In that expression foo is ill-formed as the declaration of foo in #1 doesn't for instance have a default argument for one of its parameters and so the number of template parameters and arguments don't match. An error_mark_node is thus inserted in the AST for foo in the expression bar::P >, and the type of the template bar::mem is error_mark_node. The problem is, when we go further to lookup bar::mem with the type of the 'mem' template being error_mark_node, we just crash. Now lookup_template_class_1 returns early when the type of the template is error_mark_node. Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk. From: Dodji Seketeli Date: Fri, 18 Nov 2011 19:35:04 +0100 Subject: [PATCH] PR c++/51194 - ICE with invalid alias template gcc/cp/ PR c++/51194 * pt.c (lookup_template_class_1): Go out early if the type of the template is error_mark_node. gcc/testsuite/ * g++.dg/cpp0x/alias-decl-15.C: New test. --- gcc/cp/pt.c|6 ++ gcc/testsuite/g++.dg/cpp0x/alias-decl-15.C | 17 + 2 files changed, 23 insertions(+), 0 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-15.C diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 78e263f..049e3b2 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -7270,6 +7270,12 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context, int is_dependent_type; int use_partial_inst_tmpl = false; + if (template_type == error_mark_node) + /* An error occured while building the template TEMPL, and a + diagnostic has most certainly been emitted for that + already. Let's propagate that error. */ + return error_mark_node; + gen_tmpl = most_general_template (templ); parmlist = DECL_TEMPLATE_PARMS (gen_tmpl); parm_depth = TMPL_PARMS_DEPTH (parmlist); diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-15.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-15.C new file mode 100644 index 000..2bc9b11 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-15.C @@ -0,0 +1,17 @@ +// Origin PR c++/51194 +// { dg-options "-std=c++0x" } + +template //#1 +struct foo {}; // { dg-error "provided for|foo" } + +template +struct P {}; + +template class... TT> +struct bar { +template +using mem = P...>;//#2 { dg-error "wrong number of|arguments" } +}; + +bar::mem b;//#3 { dg-error "invalid type" } + -- 1.7.6.4 -- Dodji
[wwwdocs] A bit of markup work in gcc-4.7/changes.html
Use instead of and use extend markup in one of the examples. Applied. Gerald Index: changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.7/changes.html,v retrieving revision 1.59 diff -u -r1.59 changes.html --- changes.html17 Nov 2011 16:06:18 - 1.59 +++ changes.html19 Nov 2011 15:12:54 - @@ -230,10 +230,11 @@ } - G++ now accepts the -std=c++11, -std=gnu++11, -and -Wc++11-compat options, which are equivalent -to -std=c++0x, -std=gnu++0x, -and -Wc++0x-compat, respectively. + G++ now accepts the -std=c++11, +-std=gnu++11, and -Wc++11-compat options, +which are equivalent to -std=c++0x, +-std=gnu++0x, and -Wc++0x-compat, +respectively. G++ now implements C++11 extended friend syntax: @@ -301,10 +302,11 @@ const int &x = f(1); const int &y = f(2); -Here, x refers to the temporary allocated to hold the 1 argument, -which only lives until the end of the initialization; it immediately -becomes a dangling reference. So the next statement re-uses the stack slot -to hold the 2 argument, and users of x get that value instead. +Here, x refers to the temporary allocated to hold the +1 argument, which only lives until the end of the +initialization; it immediately becomes a dangling reference. So the +next statement re-uses the stack slot to hold the 2 +argument, and users of x get that value instead. Note that this should not cause any change of behavior for temporaries of types with non-trivial destructors, as they are already destroyed at end
Re: New port^2: Renesas RL78
On Wed, 9 Nov 2011, DJ Delorie wrote: > Index: MAINTAINERS > === > rs6000 port Geoff Keating geo...@geoffk.org > rs6000 port David Edelsohn dje@gmail.com > rs6000 vector extns Aldy Hernandez al...@redhat.com > +rl78 portDJ Delorie d...@redhat.com "rl" > "rs", mind sorting this in? > Index: gcc/doc/extend.texi > === > -the SPU and M32C targets support other address spaces. On the SPU target, > for > +the SPU, M32C, and RL78 targets support other address spaces. On the SPU > target, for Mind the long line. > +On the RL78 target, variables qualified with @code{__far} are accessed > +with 32-bit pointers (20 bit addresses) rather than the default 16-bit "20-bit" > +addresses. Non-far variables are assumed to appear in the topmost 64K > +of the address space. I suggest to explicitly refer to kB or kb (byte or bit) perhaps? > Index: gcc/doc/invoke.texi > === > * PowerPC Options:: > * RS/6000 and PowerPC Options:: > +* RL78 Options:: > * RX Options:: > * S/390 and zSeries Options:: Same note on sorting as above. :-) > +@node RL78 Options > +@subsection RL78 Options > +@cindex RL78 Options Ditto. > +@item -msim > +@opindex msim > +Link in additional target libraries to support operation within a > +simulator. "Link", versus... > +@item -mmul=none > +@itemx -mmul=g13 > +@itemx -mmul=rl78 > +@opindex mmul > +Selects the type of hardware multiplication support desired. ..."Selects" feels a bit inconsistent, though I can also see the argument where "link" is what the program does, whereas "select" is what the user does. > Index: gcc/doc/md.texi > === > +@item Int3 > +An integer constant in the range 1 @dots{} 7. > +@item Int8 > +An integer constant in the range 0 @dots{} 255. Really 1..7, not 0..7? That's unexpected and a bit inconsistent with Int8. Not sure I have a good alternative to offer, perhaps someone else has a more creative idea? (Reading through this, some very fond memories of the Z80 come up in my memories. :-) > +Renesas RL78 processor support > +[2011-11-09] > +A port for the Renesas RL78 family of processors has been contributed by > +Red Hat. Don't you want to mention your name there? I would find that appropriate. Do you consider the links from install.texi important? Keep them if you do, in general we try to minimize those (and keep them in readings.html where you have added the same links). All .texi and .html changes are okay, modulo the notes above. Gerald
Re: [Patch] make it possible for the target to rename ".tm_clone_table"
On Nov 19, 2011, at 4:04 AM, Iain Sandoe wrote: > On 18 Nov 2011, at 22:06, Joseph S. Myers wrote: > >> TM_CLONE_TABLE_SECTION_NAME would better be a target hook, not a macro. > > ... done as below ... > > It should be possible for Rainer to define > TARGET_ASM_TM_CLONE_TABLE_SECTION_NAME to NULL, and have varasm use the > normal data section for tm_clone_table sections.One might wish to > re-adjust testsuite/gcc.dg/tm/20100615.c if that is done. > > > OK for trunk? Darwin bits Ok. One step closer...
Re: [Patch] make it possible for the target to rename ".tm_clone_table"
On 11/19/2011 02:04 AM, Iain Sandoe wrote: > It should be possible for Rainer to define > TARGET_ASM_TM_CLONE_TABLE_SECTION_NAME to NULL, and have varasm use > the normal data section for tm_clone_table sections.One might > wish to re-adjust testsuite/gcc.dg/tm/20100615.c if that is done. Well, not really. OSF is going to need an extension to collect2 in order to create a single table, or changes to other bits of the compiler to invoke _ITM_registerTMCloneTable for each object file's table. ... actually, there seems to be some sort of merge error. I don't see the crtstuff.c changes that called _ITM_registerTMCloneTable in the first place. > +/* Set if the target wants to override the default ".tm_clone_table" > + section name. */ > +DEFHOOKPOD > +(tm_clone_table_section_name, > + "Define this macro to specify the section name that should be used\ > + for transactional memory clone tables. If this is defined to NULL\ > + the normal data section will be used for the tables instead.\ > + The default section name is @code{\".tm_clone_table\"}.", > + const char *, ".tm_clone_table") I'd prefer we return a section object instead. I.e. pull the call to get_named_section into the hook as well. r~
Re: [PATCH] PR c++/51194 - ICE with invalid alias template
OK. Jason
Re: [Patch/RFC] PR 51216
OK. Jason
libtool update (was: Autoconf 2.64 broken on FreeBSD 10.0)
[ gcc -> gcc-patches ] On Tue, 15 Nov 2011, Andreas Tobler wrote: > With a libtool import we would cover this and some more issues. I > think Markus Trippelsdorf prepared a patch for trunk but I do not > know its status. I tested both iterations successfully. I believe Markus' latest patch is here: http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02884.html This (or a subset) is necessary to get FreeBSD 10.x working, and it also remove a couple of dozen incorrect references to Linux that RMS reported. It would be great could you have a look to get this in. Thanks, Gerald
Re: [PATCH] PR c++/51145 - Alias template in elaborated-type-specifier
On 11/19/2011 02:14 AM, Gabriel Dos Reis wrote: Just a terminology note: it should be "template alias" and not the other way around. The standard (14.5.7) uses "alias template". Jason
Re: libtool update (was: Autoconf 2.64 broken on FreeBSD 10.0)
On 2011.11.19 at 20:12 +0100, Gerald Pfeifer wrote: > [ gcc -> gcc-patches ] > > On Tue, 15 Nov 2011, Andreas Tobler wrote: > > With a libtool import we would cover this and some more issues. I > > think Markus Trippelsdorf prepared a patch for trunk but I do not > > know its status. I tested both iterations successfully. > > I believe Markus' latest patch is here: > > http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02884.html > > This (or a subset) is necessary to get FreeBSD 10.x working, and it also > remove a couple of dozen incorrect references to Linux that RMS reported. > > It would be great could you have a look to get this in. I have deleted the tarballs because they don't apply cleanly anymore. But this is not rocket science and you can easily update to the new libtool yourself by just copying the new version to the gcc root dir and running "ACLOCAL='aclocal -I .. -I ../config' autoreconf -v" in the various subdirs. -- Markus
[Patch,AVR]: Clean up SFR offset usage.
Subtracting 0x20 to get the SFR address from a RAM address is scattered all over the backend. The patch makes - PRINT_OPERAND_PUNCT_VALID_P and uses %- to subtract the SFR offset instead of hard coded magic number 0x20 all over the place. The offset is stored in a new field base_arch_s.sfr_offset Code of out_movhi_r_mr, out_movhi_mr_r, out_shift_with_cnt undergoes clean-up, too. output_reload_in_const is generic enough to handle 3- and 4- byte symbols. Tested without regressions. Ok for trunk? Johann * config/avr/avr.h (PRINT_OPERAND_PUNCT_VALID_P): Add '-'. (struct base_arch_s): Add field sfr_offset. * config/avr/avr-devices.c: Ditto. And initialize it. * config/avr/avr-c.c (avr_cpu_cpp_builtins): New built-in define __AVR_SFR_OFFSET__. * config/avr/avr-protos.h (out_movqi_r_mr, out_movqi_mr_r): Remove. (out_movhi_r_mr, out_movhi_mr_r): Remove. (out_movsi_r_mr, out_movsi_mr_r): Remove. (*cbi, *sbi): Use %- instead of magic number 0x20. (*insv.io*, insv.not.io): Ditto. * config/avr/avr.c (out_movsi_r_mr, out_movsi_mr_r): Make static. (print_operand): Map "%-" to subtractio of SFR offset. (output_movqi): Clean up call of out_movqi_mr_r. (output_movhi): Clean up call of out_movhi_mr_r. (avr_file_start): Use avr_current_arch->sfr_offset instead of magic -0x20. Use TMP_REGNO, ZERO_REGNO instead of 0, 1. (avr_out_sbxx_branch): Use %- instead of magic -0x20. (out_movqi_r_mr, out_movqi_mr_r): Ditto. And make static. (out_movhi_r_mr, out_movhi_mr_r): Ditto. And use avr_asm_len. (out_shift_with_cnt): Clean up code and: Use avr_asm_len. (output_movsisf): Use output_reload_insisf for all CONSTANT_P sources. (avr_out_movpsi): USE avr_out_reload_inpsi for all CONSTANT_P sources. Clean up call of avr_out_store_psi. (output_reload_in_const): Don't cut symbols longer than 2 bytes. (output_reload_insisf): Filter CONST_INT_P or CONST_DOUBLE_P to try if setting pre-cleared register is advantageous. Index: config/avr/avr.md === --- config/avr/avr.md (revision 181510) +++ config/avr/avr.md (working copy) @@ -34,6 +34,8 @@ ;;..x..Constant Direct Program memory address. ;; ~ Output 'r' if not AVR_HAVE_JMP_CALL. ;; ! Output 'e' if AVR_HAVE_EIJMP_EICALL. +;; - Output '-0x20', i.e. subtraction of offset between RAM address +;; and SFR address. (define_constants @@ -45,12 +47,12 @@ (define_constants (LPM_REGNO 0) ; implicit target register of LPM (TMP_REGNO 0) ; temporary register r0 (ZERO_REGNO 1) ; zero register r1 - - (SREG_ADDR 0x5F) - (SP_ADDR 0x5D) - ;; Register holding the address' high part when loading via ELPM - (RAMPZ_ADDR 0x5B) + ;; RAM addresses of some SFRs common to all Devices. + + (SREG_ADDR 0x5F) ; Status Register + (SP_ADDR 0x5D) ; Stack Pointer + (RAMPZ_ADDR 0x5B) ; Address' high part when loading via ELPM ]) (define_c_enum "unspec" @@ -4658,25 +4660,25 @@ (define_insn "sez" (define_insn "*cbi" [(set (mem:QI (match_operand 0 "low_io_address_operand" "n")) - (and:QI (mem:QI (match_dup 0)) - (match_operand:QI 1 "single_zero_operand" "n")))] - "(optimize > 0)" -{ - operands[2] = GEN_INT (exact_log2 (~INTVAL (operands[1]) & 0xff)); - return AS2 (cbi,%m0-0x20,%2); -} +(and:QI (mem:QI (match_dup 0)) +(match_operand:QI 1 "single_zero_operand" "n")))] + "optimize > 0" + { +operands[2] = GEN_INT (exact_log2 (~INTVAL (operands[1]) & 0xff)); +return "cbi %m0%-,%2"; + } [(set_attr "length" "1") (set_attr "cc" "none")]) (define_insn "*sbi" [(set (mem:QI (match_operand 0 "low_io_address_operand" "n")) - (ior:QI (mem:QI (match_dup 0)) - (match_operand:QI 1 "single_one_operand" "n")))] - "(optimize > 0)" -{ - operands[2] = GEN_INT (exact_log2 (INTVAL (operands[1]) & 0xff)); - return AS2 (sbi,%m0-0x20,%2); -} +(ior:QI (mem:QI (match_dup 0)) +(match_operand:QI 1 "single_one_operand" "n")))] + "optimize > 0" + { +operands[2] = GEN_INT (exact_log2 (INTVAL (operands[1]) & 0xff)); +return "sbi %m0%-,%2"; + } [(set_attr "length" "1") (set_attr "cc" "none")]) @@ -5635,9 +5637,9 @@ (define_insn "*insv.io" (match_operand:QI 2 "nonmemory_operand""L,P,r"))] "" "@ - cbi %m0-0x20,%1 - sbi %m0-0x20,%1 - sbrc %2,0\;sbi %m0-0x20,%1\;sbrs %2,0\;cbi %m0-0x20,%1" + cbi %m0%-,%1 + sbi %m0%-,%1 + sbrc %2,0\;sbi %m0%-,%1\;sbrs %2,0\;cbi %m0%-,%1" [(set_attr "length" "1,1,4") (set_attr "cc" "none")]) @@ -5647,7 +5649,7 @@ (define_insn "*insv.not.io" (match_operand:QI 1 "const_0_to_7_operand""n")) (not:QI (match_operand:QI 2 "register_operand" "r")))] "" - "sbrs %2,0\;sbi %m0-0x20
[patch] update configury for FreeBSD 10 on gcc-4.6 branch
Hi all, the below patch updates the configury to be able to build gcc-4.6 on FreeBSD 10. I attach only the source files which have changed. This is the list of affected files, I left libgo away since it is not clear to me how the configury is done there. libtool.m4 libgomp/configure libquadmath/configure zlib/configure libstdc++-v3/configure libmudflap/configure boehm-gc/configure lto-plugin/configure libjava/libltdl/configure libjava/libltdl/acinclude.m4 libjava/configure.ac libjava/classpath/configure libjava/configure gcc/configure libobjc/configure libgfortran/configure libffi/configure libssp/configure The CL look like this. 2011-11-19 Andreas Tobler * libtool.m4: Additional FreeBSD 10 fixes. 2011-11-19 Andreas Tobler * configure: Regenerate. Is this ok for 4.6 branch? Thanks, Andreas Index: libtool.m4 === --- libtool.m4 (revision 181511) +++ libtool.m4 (working copy) @@ -2273,7 +2273,7 @@ objformat=`/usr/bin/objformat` else case $host_os in -freebsd[[123]]*) objformat=aout ;; +freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -2291,7 +2291,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) @@ -4804,7 +4804,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. -freebsd2*) +freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -5751,7 +5751,7 @@ esac ;; - freebsd[[12]]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no Index: libjava/configure.ac === --- libjava/configure.ac(revision 181511) +++ libjava/configure.ac(working copy) @@ -1060,7 +1060,7 @@ *-*-cygwin*) # Don't set THREADLIBS here. Cygwin doesn't have -lpthread. ;; - *-*-freebsd[[1234]]*) + *-*-freebsd[[234]].*) # Before FreeBSD 5, it didn't have -lpthread (or any library which # merely adds pthread_* functions) but it does have a -pthread switch # which is required at link-time to select -lc_r *instead* of -lc. Index: libjava/libltdl/acinclude.m4 === --- libjava/libltdl/acinclude.m4(revision 181511) +++ libjava/libltdl/acinclude.m4(working copy) @@ -1377,7 +1377,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) @@ -3035,7 +3035,7 @@ ;; esac ;; - freebsd[[12]]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; @@ -5669,7 +5669,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. -freebsd2*) +freebsd2.*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
Fix PR rtl-optimization/51187
This is the miscompilation of the cross-compiler targetting AVR by the native compiler on the SPARC at -O2, a latent problem in reorg.c that is exposed in the 4.5.x (and later) series by the introduction of __builtin_unreachable. relax_delay_slots has code that tries to detect if a simple (conditional) jump is useless, i.e. if there is no active insn between the jump and the label. If so, it first re-emits the insns in the delay slot(s) of the jump and then invokes delete_related_insns on the jump. delete_related_insns first deletes the jump and then, if the number of uses of the label has reached zero, calls itself recursively on the label. Now, when invoked on a label, delete_related_insns not only deletes the label but also the entire extended basic block starting at the label if there is a barrier just before the label. With __builtin_unreachable you can have barriers at somewhat unexpected places and the jump might be guarding the fallthrough to the barrier; deleting the jump in this case doesn't mean that the block at the label can be deleted. The solution of deleting the barrier with the jump would work, but happens to be tricky to implement in delete_related_insns. The attached patch disables the optimization instead in this case, on the grounds that it isn't the job of reorg.c to optimize the CFG when no other RTL pass was able to do it before. Bootstrapped/regtested on SPARC/Linux, applied on mainline, 4.6/4.5 branches. 2011-11-19 Eric Botcazou PR rtl-optimization/51187 * reorg.c (relax_delay_slots): Do not consider a jump useless if there is a barrier between the jump and its target label. 2011-11-19 Eric Botcazou * gcc.dg/delay-slot-2.c: New test. -- Eric Botcazou Index: reorg.c === --- reorg.c (revision 181505) +++ reorg.c (working copy) @@ -3600,9 +3600,11 @@ relax_delay_slots (rtx first) } } + /* See if we have a simple (conditional) jump that is useless. */ if (! INSN_ANNULLED_BRANCH_P (delay_insn) - && prev_active_insn (target_label) == insn && ! condjump_in_parallel_p (delay_insn) + && prev_active_insn (target_label) == insn + && ! BARRIER_P (prev_nonnote_insn (target_label)) #ifdef HAVE_cc0 /* If the last insn in the delay slot sets CC0 for some insn, various code assumes that it is in a delay slot. We could /* PR rtl-optimization/51187 */ /* Reported by Jurij Smakov */ /* { dg-do compile } */ /* { dg-options "-g -O2" } */ extern int printf (__const char *__restrict __format, ...); extern void print_c_condition (const char *); enum decision_type { DT_num_insns, DT_mode, DT_code, DT_veclen, DT_elt_zero_int, DT_elt_one_int, DT_elt_zero_wide, DT_elt_zero_wide_safe, DT_const_int, DT_veclen_ge, DT_dup, DT_pred, DT_c_test, DT_accept_op, DT_accept_insn }; struct decision_test { struct decision_test *next; enum decision_type type; union { int num_insns; struct { const char *name; } pred; const char *c_test; int veclen; int dup; long intval; int opno; struct { int code_number; int lineno; int num_clobbers_to_add; } insn; } u; }; enum routine_type { RECOG, SPLIT, PEEPHOLE2 }; void write_cond (struct decision_test *p, int depth, enum routine_type subroutine_type) { switch (p->type) { case DT_num_insns: printf ("peep2_current_count >= %d", p->u.num_insns); break; case DT_code: printf ("GET_CODE (x%d) == ", depth); break; case DT_veclen: printf ("XVECLEN (x%d, 0) == %d", depth, p->u.veclen); break; case DT_elt_zero_int: printf ("XINT (x%d, 0) == %d", depth, (int) p->u.intval); break; case DT_elt_one_int: printf ("XINT (x%d, 1) == %d", depth, (int) p->u.intval); break; case DT_elt_zero_wide: case DT_elt_zero_wide_safe: printf ("XWINT (x%d, 0) == ", depth); print_host_wide_int (p->u.intval); break; case DT_const_int: printf ("x%d == const_int_rtx[MAX_SAVED_CONST_INT + (%d)]", depth, (int) p->u.intval); break; case DT_veclen_ge: printf ("XVECLEN (x%d, 0) >= %d", depth, p->u.veclen); break; case DT_dup: printf ("rtx_equal_p (x%d, operands[%d])", depth, p->u.dup); break; case DT_pred: printf ("%s (x%d)", p->u.pred.name, depth); break; case DT_c_test: print_c_condition (p->u.c_test); break; case DT_accept_insn: ((void)(__builtin_expect(!(subroutine_type == RECOG), 0) ? __builtin_unreachable(), 0 : 0)); ((void)(__builtin_expect(!(p->u.insn.num_clobbers_to_add), 0) ? __builtin_unreachable(), 0 : 0)); printf ("pnum_clobbers != NULL"); break; default: __builtin_unreachable(); } } /* { dg-final { scan-assembler "printf" } } */
[wwwdocs] put -Wdelete-non-virtual-dtor in gcc-4.7/changes.html
Applied Index: changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.7/changes.html,v retrieving revision 1.60 diff -u -r1.60 changes.html --- changes.html19 Nov 2011 15:15:13 - 1.60 +++ changes.html19 Nov 2011 22:02:48 - @@ -312,6 +312,14 @@ of types with non-trivial destructors, as they are already destroyed at end of full-expression; the change is that now the storage is released as well. + + A new command-line option -Wdelete-non-virtual-dtor + has been added to warn when delete is used to destroy + an instance of a class which has virtual functions and non-virtual + destructor. It is unsafe to delete an instance of a derived class + through a pointer to a base class if the base class does not have a + virtual destructor. This warning is enabled by -Wall. + Runtime Library (libstdc++)
Re: [patch] update configury for FreeBSD 10 on gcc-4.6 branch
On Sat, 19 Nov 2011, Andreas Tobler wrote: > the below patch updates the configury to be able to build gcc-4.6 on > FreeBSD 10. I attach only the source files which have changed. > libjava/libltdl/acinclude.m4 I don't see this one in your ChangeLog? > Is this ok for 4.6 branch? Merging upstream changes from libtool that unbreak bootstrap on a primary platform and are completely specific and isolated to that platform should always be fine. You did not indicate how you tested it, but assuming a full bootstrap and testsuite run (which platform exactly?) please go ahead. Thanks! > Index: libjava/configure.ac > === > --- libjava/configure.ac (revision 181511) > +++ libjava/configure.ac (working copy) > @@ -1060,7 +1060,7 @@ > *-*-cygwin*) > # Don't set THREADLIBS here. Cygwin doesn't have -lpthread. > ;; > - *-*-freebsd[[1234]]*) > + *-*-freebsd[[234]].*) > # Before FreeBSD 5, it didn't have -lpthread (or any library which > # merely adds pthread_* functions) but it does have a -pthread switch > # which is required at link-time to select -lc_r *instead* of -lc. This is a separate change from the libtool import, right? Ever since 2011-02-02 Gerald Pfeifer * config.gcc (*-*-freebsd[12], *-*-freebsd[12].*, *-*-freebsd*aout*): Move to the unsupported targets list. GCC per se does not support FreeBSD 2.x any more. On the libtool side, we should stick with what we get from upstream. For other things, like the above, I suggest to remove both 1 and 2. Can you also make the libjava change on trunk, copying java-patches@ ? Gerald
Re: [patch] update configury for FreeBSD 10 on gcc-4.6 branch
On 19.11.11 23:15, Gerald Pfeifer wrote: On Sat, 19 Nov 2011, Andreas Tobler wrote: the below patch updates the configury to be able to build gcc-4.6 on FreeBSD 10. I attach only the source files which have changed. libjava/libltdl/acinclude.m4 I don't see this one in your ChangeLog? Sigh, too many things in parallel: Index: libltdl/ChangeLog === --- libltdl/ChangeLog (revision 181511) +++ libltdl/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2011-11-19 Andreas Tobler + + * acinclude.m4: Additional FreeBSD 10 fixes. + * configure: Regenerate. + Is this ok for 4.6 branch? Merging upstream changes from libtool that unbreak bootstrap on a primary platform and are completely specific and isolated to that platform should always be fine. You did not indicate how you tested it, but assuming a full bootstrap and testsuite run (which platform exactly?) please go ahead. Well, here I'm a bit sloppy, I always test with a full bootstrap and submit the results. I did this for this patch a few weeks ago for trunk. I'll resubmit new results as soon as the tests completed. Thanks! Index: libjava/configure.ac === --- libjava/configure.ac(revision 181511) +++ libjava/configure.ac(working copy) @@ -1060,7 +1060,7 @@ *-*-cygwin*) # Don't set THREADLIBS here. Cygwin doesn't have -lpthread. ;; - *-*-freebsd[[1234]]*) + *-*-freebsd[[234]].*) # Before FreeBSD 5, it didn't have -lpthread (or any library which # merely adds pthread_* functions) but it does have a -pthread switch # which is required at link-time to select -lc_r *instead* of -lc. This is a separate change from the libtool import, right? Ever since 2011-02-02 Gerald Pfeifer * config.gcc (*-*-freebsd[12], *-*-freebsd[12].*, *-*-freebsd*aout*): Move to the unsupported targets list. GCC per se does not support FreeBSD 2.x any more. On the libtool side, we should stick with what we get from upstream. For other things, like the above, I suggest to remove both 1 and 2. Yes, this is separate from the libtool import. I thought I could integrate this one too since I have to regen configure anyway. Will update. Can you also make the libjava change on trunk, copying java-patches@ ? Yes. Thanks for the feedback. Andreas
[wwwdocs/news] Add link to GNU Tools Cauldron 2012
Committed to wwwdocs. Diego. Index: index.html === RCS file: /cvs/gcc/wwwdocs/htdocs/index.html,v retrieving revision 1.825 diff -u -d -u -p -r1.825 index.html --- index.html 18 Nov 2011 23:05:16 - 1.825 +++ index.html 19 Nov 2011 23:42:01 - @@ -53,6 +53,14 @@ mission statement. +GNU Tools Cauldron 2012 +[2011-11-18] +IUUK (Computer Science Institute, Charles University), CE-ITI +(Institute for Theoretical Computer Science) and Google are organizing +a http://gcc.gnu.org/wiki/cauldron2012";>workshop for GNU +Tools developers. The workshop will be held in July 2012 at +Charles University, Prague. + POWER7 on the GCC Compile Farm [2011-11-10] IBM has donated a 64 processor POWER7 machine (3.55 GHz, 64 GB RAM)
[C++ Patch] PR 51230
Hi, apparently in the new deductions notes we are not handling correctly non-type parameters in some messages, like in: template struct A {}; template void foo(A, A); void bar() { foo(A<0>(), A<1>()); } we use %qT in unify_inconsistency and the output is garbled. The below is the most compact fix I have been able to figure out, but of course other solutions are possible, like separate error messages for non-type (TYPE_P (parm) to tell which appears to work fine), etc. Tested x86_64-linux. Thanks, Paolo. // /cp 2011-11-20 Paolo Carlini PR c++/51230 * pt.c (unify_inconsistency): Handle non-type parameters better. /cp 2011-11-20 Paolo Carlini PR c++/51230 * g++.dg/template/error46.C: New. Index: testsuite/g++.dg/template/error46.C === --- testsuite/g++.dg/template/error46.C (revision 0) +++ testsuite/g++.dg/template/error46.C (revision 0) @@ -0,0 +1,11 @@ +// PR c++/51230 + +template struct A {}; + +template void foo(A, A); // { dg-message "template" } + +void bar() +{ + foo(A<0>(), A<1>()); // { dg-error "no matching" } +} +// { dg-message "candidate|parameter 'N' ('0' and '1')" { target *-*-* } 9 } Index: cp/pt.c === --- cp/pt.c (revision 181521) +++ cp/pt.c (working copy) @@ -5501,7 +5501,7 @@ unify_inconsistency (bool explain_p, tree parm, tr { if (explain_p) inform (input_location, - " deduced conflicting types for parameter %qT (%qT and %qT)", + " conflicting deductions for parameter %qE (%qE and %qE)", parm, first, second); return 1; }
[wwwdocs] gcc-4.3/porting_to.html headers
This matches a clean up I have done for the GCC 4.6 and GCC 4.4 variants of this document. Applied. Gerald Index: porting_to.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.3/porting_to.html,v retrieving revision 1.6 diff -u -r1.6 porting_to.html --- porting_to.html 22 Feb 2008 20:06:39 - 1.6 +++ porting_to.html 20 Nov 2011 01:59:00 - @@ -26,9 +26,9 @@ manner. Additions and suggestions for improvement are welcome. -C language issues +C language issues -Semantic change of extern inline +Semantic change of extern inline When compiling with -std=c99 or -std=gnu99, @@ -75,7 +75,7 @@ { return 5; } -New warnings +New warnings Significant changes were made to -Wconversion. In addition, improvements to the GCC infrastructure allow improvements in @@ -96,9 +96,9 @@ are fixed, or for conversion warnings add -Wno-conversion. -C++ language issues +C++ language issues -Header dependency cleanup +Header dependency cleanup As detailed @@ -170,7 +170,7 @@ -Removal of Pre-ISO headers +Removal of Pre-ISO headers Various backwards and deprecated headers have been removed. @@ -318,8 +318,7 @@ For future reference, available headers are listed http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch03s02.html";>here. -An example. - +An example. #include@@ -372,7 +371,7 @@ Note that explicitly qualifying cout as std::cout and likewise for endl instead of globally injecting the std namespace (ie, using namespace std) will also work. -Name lookup changes +Name lookup changes GCC by default no longer accepts code such as @@ -412,7 +411,7 @@ conforming. -Duplicate function parameters +Duplicate function parameters Duplicate function parameters are now treated uniformly as an error in C and C++. @@ -438,7 +437,7 @@ -Stricter requirements for function main signature +Stricter requirements for function main signature The two-argument signature for main has int as the first argument. GCC 4.3 rigorously enforces this. @@ -464,7 +463,7 @@ { return 0; } -Explicit template specialization cannot have a storage class +Explicit template specialization cannot have a storage class Specializations of templates cannot explicitly specify a storage class, and have the same storage as the primary template. This is a @@ -499,9 +498,9 @@ void foo (); -Java issues +Java issues -Java 1.2 and earlier requires upgraded ant +Java 1.2 and earlier requires upgraded ant The use of the Eclipse Java compiler in GCC 4.3 enables the use of all 1.5 language features, but use with older versions of @@ -520,7 +519,7 @@ svn diff -r529854:529855 http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java -Links +Links Jakub Jelinek, https://www.redhat.com/archives/fedora-devel-list/2008-January/msg00128.html";>Mass rebuild status with gcc-4.3.0-0.4 of rawhide-20071220 @@ -547,9 +546,5 @@ - - - -
Re: [wwwdocs] gcc-4.6/porting_to.html
On Wed, 12 Oct 2011, Gerald Pfeifer wrote: > For reference hre is the full patch that's now live on the system. And this take into account a suggestion by Matthias Klose (cf. http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01014.html ). Applied. Gerald Index: porting_to.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.6/porting_to.html,v retrieving revision 1.5 diff -u -r1.5 porting_to.html --- porting_to.html 15 Nov 2011 13:38:24 - 1.5 +++ porting_to.html 19 Nov 2011 16:56:39 - @@ -60,10 +60,9 @@ without changing the result or logic of the surrounding code. If not, annotate it with __attribute__((__unused__)). -As a workaround, remove -Werror until the new warnings -are fixed. For conversion warnings add --Wno-unused-but-set-variable or --Wno-unused-but-set-parameter. +As a workaround, add +-Wno-error=unused-but-set-variable or +-Wno-error=unused-but-set-parameter. C++ language issues
Re: [wwwdocs/news] Add link to GNU Tools Cauldron 2012
On Nov 19, 2011, at 18:46, Diego Novillo wrote: > Committed to wwwdocs. BTW, I had taken the liberty to add a link to gcc.gnu.org/wiki under the header Events. I also removed some 2010 events, as they seemed stale now. Feel free to change if necessary. -Geert
Re: [Patch,AVR]: Clean up SFR offset usage.
2011/11/20 Georg-Johann Lay : > Subtracting 0x20 to get the SFR address from a RAM address is scattered all > over the backend. The patch makes - PRINT_OPERAND_PUNCT_VALID_P and uses %- > to > subtract the SFR offset instead of hard coded magic number 0x20 all over the > place. The offset is stored in a new field base_arch_s.sfr_offset I don't like '%-' as a sequence and I don't like it as a suffix. May be a right way is an adding a new prefix '%i' or '%I'. I.e. %m0 - memory address %i0 - io address (equal to %m0 - 0x20) Denis.