Re: [SFN+LVU+IEPM v4 7/9] [LVU] Introduce location views

2018-02-08 Thread Alexandre Oliva
symbolic views everywhere, + instead of special-casing zero views, but then we'd be unable to + optimize out locviewlists that contain only zeros. */ static bool output_asm_line_debug_info (void) -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change

[C++] [PR84231] overload on cond_expr in template

2018-02-08 Thread Alexandre Oliva
ot; : "x"); +} + +void normal_function(bool b) +{ + // Both cases compile OK in non-template function: + f % (b ? "x" : "x"); + f % (b ? "" : "x"); + + function_template(b); +} -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoli

Re: [SFN+LVU+IEPM v4 7/9] [LVU] Introduce location views

2018-02-08 Thread Alexandre Oliva
On Feb 8, 2018, Jason Merrill wrote: > On 02/07/2018 02:36 AM, Alexandre Oliva wrote: >> +/* Output symbol LAB1 as an unsigned LEB128 quantity. */ > Let's mention here that the value of LAB1 must be an assemble-time > constant (such as a view counter), since we can't

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-08 Thread Alexandre Oliva
On Jan 25, 2018, Alexandre Oliva wrote: > On Jan 24, 2018, Jakub Jelinek wrote: >> I think this asks for >> if (flag_checking) >> gcc_assert (block_within_block_p (block, >> DECL_INITIAL (current_function_decl), >> true)); > 'k, changed. >> Ot

Re: [SFN+LVU+IEPM v4 7/9] [LVU] Introduce location views

2018-02-08 Thread Alexandre Oliva
On Feb 8, 2018, Jason Merrill wrote: > On Thu, Feb 8, 2018 at 7:56 AM, Alexandre Oliva wrote: >> On Feb 7, 2018, Jason Merrill wrote: >> >>> OK, that makes sense. But I'm still uncomfortable with choosing an >>> existing opcode for that purpose, which

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-09 Thread Alexandre Oliva
On Feb 9, 2018, Jeff Law wrote: > On 02/08/2018 08:53 PM, Alan Modra wrote: >> On Fri, Feb 09, 2018 at 01:21:27AM -0200, Alexandre Oliva wrote: >>> Here's what I checked in, right after the LVU patch. >>> >>> [IEPM] Introduce inline entry point marke

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-09 Thread Alexandre Oliva
On Feb 9, 2018, Jeff Law wrote: > On 02/08/2018 08:53 PM, Alan Modra wrote: >> On Fri, Feb 09, 2018 at 01:21:27AM -0200, Alexandre Oliva wrote: >>> Here's what I checked in, right after the LVU patch. >>> >>> [IEPM] Introduce inline entry point marke

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-09 Thread Alexandre Oliva
On Feb 9, 2018, Jakub Jelinek wrote: > On Fri, Feb 09, 2018 at 07:01:25PM -0200, Alexandre Oliva wrote: >> So, as discussed on IRC, I'm trying to use a target hook to allow >> targets to indicate that their length attrs have been assessed for this >> purpose

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-09 Thread Alexandre Oliva
On Feb 9, 2018, Alexandre Oliva wrote: > On Feb 9, 2018, Jeff Law wrote: >> On 02/08/2018 08:53 PM, Alan Modra wrote: >>> On Fri, Feb 09, 2018 at 01:21:27AM -0200, Alexandre Oliva wrote: >>>> Here's what I checked in, right after the LVU patch. >>>

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-10 Thread Alexandre Oliva
as gone through more than my initial smoke testing on x86_64, but my own testing will take some time, and I wanted to give you something that at least stood a chance of fixing the problem before crashing in bed :-) [LVU] deal with md final_scan_insn From: Alexandre Oliva Ports call final_scan_insn

[LVU] use asm .loc and get gas to compute views on the side

2018-02-10 Thread Alexandre Oliva
- a/gcc/final.c +++ b/gcc/final.c @@ -2521,6 +2521,15 @@ final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, if (align && NEXT_INSN (insn)) { + if (!DECL_IGNORED_P (current_function_decl) + && debug_variable

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-10 Thread Alexandre Oliva
oncern about them was unjustified, and the space they take up is tolerable. Or maybe we can find some way to get the most out of them without actually breaking anything. We'll see... -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-11 Thread Alexandre Oliva
note needs to be emitted before INSN. Sets IS_STMT to TRUE if the line should be marked as a possible -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board me

Re: [SFN+LVU+IEPM v4 7/9] [LVU] Introduce location views

2018-02-11 Thread Alexandre Oliva
of the same macro that was already there, right before the locview block output: ASM_OUTPUT_LABEL (asm_out_file, list_head->ll_symbol); Shouldn't it be ASM_OUTPUT_DEBUG_LABEL too? is fixing these enough to address the problem you reported? Thanks, -- Alexandre Oliva, freedom fighterh

Re: [SFN+LVU+IEPM v4 7/9] [LVU] Introduce location views

2018-02-11 Thread Alexandre Oliva
On Feb 11, 2018, Andreas Schwab wrote: > On Feb 09 2018, Alexandre Oliva wrote: >> + if (list_head->vl_symbol && dwarf2out_locviews_in_attribute ()) >> +{ >> + ASM_OUTPUT_LABEL (asm_out_file, list_head->vl_symbol); > That needs to use ASM_OU

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-12 Thread Alexandre Oliva
On Feb 9, 2018, Alexandre Oliva wrote: > On Feb 9, 2018, Jakub Jelinek wrote: >> On Fri, Feb 09, 2018 at 07:01:25PM -0200, Alexandre Oliva wrote: >>> So, as discussed on IRC, I'm trying to use a target hook to allow >>> targets to indicate that their length a

Re: [SFN+LVU+IEPM v4 7/9] [LVU] Introduce location views

2018-02-12 Thread Alexandre Oliva
On Feb 12, 2018, Andreas Schwab wrote: > On Feb 12 2018, Alexandre Oliva wrote: >> On Feb 11, 2018, Andreas Schwab wrote: >> >>> On Feb 09 2018, Alexandre Oliva wrote: >> >>>> + if (list_head->vl_symbol && dwarf2out_locviews_in_a

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-13 Thread Alexandre Oliva
On Feb 12, 2018, Alexandre Oliva wrote: > This patch supersedes the previous one. Testing underway... Ok if it > succeeds? I failed to update the patch I posted after making a correct to symbol poisoning, that had caused builds to fail right away, sorry. Thanks, Rainer, for catchi

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-21 Thread Alexandre Oliva
table->view++; } if (file_num != table->file_num) diff --git a/gcc/testsuite/gcc.dg/graphite/pr84404.c b/gcc/testsuite/gcc.dg/graphite/pr84404.c new file mode 100644 index ..858e651cfab7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr84404.c @@ -0,0 +1,18 @@ +/* { dg

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-21 Thread Alexandre Oliva
therwise used, the stmt will be cleaned up in clean_unused_block_pointer. */ - if (is_gimple_debug (stmt)) + if (is_gimple_debug (stmt) + && (debug_inline_points != 4 || !gimple_debug_inline_entry_p (stmt))) continue; if (gimple_clobber_p (stmt)) -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer

Re: [C++] [PR84231] overload on cond_expr in template

2018-02-27 Thread Alexandre Oliva
On Feb 15, 2018, Jason Merrill wrote: > On Thu, Feb 8, 2018 at 9:09 PM, Alexandre Oliva wrote: >> + /* If it was supposed to be an rvalue but it's not, adjust >> +one of the operands so that any overload resolution >> +taking this CON

Re: [PR81611] improve auto-inc

2018-02-27 Thread Alexandre Oliva
= get_next_ref (REGNO (inc_insn.reg0), bb, + reg_next_def); + + if (other_insn && luid > DF_INSN_LUID (other_insn)) + reg0_use = NULL; + } + + mem_insn.insn = reg0_use; + +

Re: [C++] [PR84231] overload on cond_expr in template

2018-02-27 Thread Alexandre Oliva
mplate(bool b) +{ + // Compiles OK with array lvalue: + f % (b ? "x" : "x"); + + // Used to fails with pointer rvalue: + f % (b ? "" : "x"); +} + +void normal_function(bool b) +{ + // Both cases compile OK in non-template function: + f % (b ? "x&q

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-27 Thread Alexandre Oliva
On Feb 21, 2018, Alexandre Oliva wrote: > On Feb 15, 2018, Szabolcs Nagy wrote: >> i see assembler slow downs with these location view patches >> i opened https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84408 > [LVU] reset view at function entry, omit views at line

[PR c++/84492] return stmt expr ending with overload

2018-02-28 Thread Alexandre Oliva
"cannot resolve overloaded function" } +} -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer

[PR c++/84593] ice on braced init with uninit ref field

2018-02-28 Thread Alexandre Oliva
p;b; +} c = {}; // { dg-error "uninitialized reference" } -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer

[PR c++/84596] implicit conv in static assert

2018-02-28 Thread Alexandre Oliva
..ee709f4200fe --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr84596.C @@ -0,0 +1,7 @@ +// PR c++/84596 +// { dg-do compile { target c++11 } } + +template +void b(int c) { + static_assert (c, "c"); // { dg-error "non-constant|not a constant" } +} -- Alexandre Oliva, freedom fighter

Re: [PR c++/84596] implicit conv in static assert

2018-03-01 Thread Alexandre Oliva
On Mar 1, 2018, Marek Polacek wrote: > Here's my take on this; Alex, sorry for interfering. No worries, thanks a lot for taking care of this! -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free!

Re: [PR c++/84593] ice on braced init with uninit ref field

2018-03-01 Thread Alexandre Oliva
On Feb 28, 2018, Jason Merrill wrote: > On Wed, Feb 28, 2018 at 7:08 AM, Alexandre Oliva wrote: >> Don't allow the initializer expr to be NULL in a ctor initializer >> list, make it error_marker_node instead. > I don't want error_mark_nodes in a CONSTRUCTOR, ei

Re: [PR c++/84492] return stmt expr ending with overload

2018-03-01 Thread Alexandre Oliva
On Feb 28, 2018, Jason Merrill wrote: > On Wed, Feb 28, 2018 at 7:06 AM, Alexandre Oliva wrote: >> We ICEd when returning a stmt expr that ends with an overloaded >> function. It's ill-formed when we can't convert the function name to >> the return type, but we s

Re: [C++] [PR84231] overload on cond_expr in template

2018-03-01 Thread Alexandre Oliva
On Feb 28, 2018, Jason Merrill wrote: > On Wed, Feb 28, 2018 at 12:24 AM, Alexandre Oliva wrote: >> + if (processing_template_decl) >> +result_type = cp_build_reference_type (result_type, !is_lvalue); > If !is_lvalue, we don't want a reference type at all, as th

[PR84620] output symbolic entry_view as data2, not addr

2018-03-01 Thread Alexandre Oliva
WIDE_INT GTY ((tag ("dw_val_class_unsigned_const"))) val_unsigned; + char * GTY ((tag ("dw_val_class_symview"))) val_symbolic_view; double_int GTY ((tag ("dw_val_class_const_double"))) val_double; wide_int_ptr GTY ((tag ("dw_val_class_wide_int"

Re: [PATCH] Fix C++ ref op= ICE in the gimplifier with -g (PR c++/84704)

2018-03-05 Thread Alexandre Oliva
ppose my concerns are unfounded, and in case they aren't, we'll soon find out ;-) So, no objections from me; thanks for looking into this! -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA

Re: [PR c++/84593] ice on braced init with uninit ref field

2018-03-05 Thread Alexandre Oliva
On Mar 2, 2018, Jason Merrill wrote: > On Fri, Mar 2, 2018 at 2:57 AM, Alexandre Oliva wrote: >> + gcc_assert (TREE_CODE (type) == REFERENCE_TYPE); >> + init = fold (convert (type, integer_zero_node)); > Maybe build_zero_cst? Sure. I wonder, is there any reason

Re: [PR84620] output symbolic entry_view as data2, not addr

2018-03-05 Thread Alexandre Oliva
On Mar 2, 2018, Alexandre Oliva wrote: > Mark Wielaard is implementing support for LVU and IEPM in elfutils, and > he was surprised by the encoding of DW_AT_GNU_entry_view; so was I! > When GCC computes and outputs views internally (broken without internal > view resets), it output

Re: [C++] [PR84231] overload on cond_expr in template

2018-03-05 Thread Alexandre Oliva
p;) { return *this; } +}; + +format f; + +template +void function_template(bool b) +{ + // Compiles OK with array lvalue: + f % (b ? "x" : "x"); + + // Used to fails with pointer rvalue: + f % (b ? "" : "x"); +} + +void normal_function(bool b) +{ + // B

Re: [PR c++/84593] ice on braced init with uninit ref field

2018-03-05 Thread Alexandre Oliva
x; + int c = 0; + int &b; +} c = {}; // { dg-error "uninitialized reference" } -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free S

Re: [PR84620] output symbolic entry_view as data2, not addr

2018-03-08 Thread Alexandre Oliva
ed, but would it in practice? I can see that mandatory [us]leb128 fields could be a problem, but are there any fields that involve offsets into .debug_info, and that must be represented as [us]leb128? I don't think so. -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ Y

[PR84682] disregard address constraints on non-addresses

2018-03-08 Thread Alexandre Oliva
ew file mode 100644 index ..543a307d6c12 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr84682-3.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* This is like pr84682-1.c, but with an extra memory constraint, to + check that we don't disable process_address altogether just because +

Re: [PR84620] output symbolic entry_view as data2, not addr

2018-03-09 Thread Alexandre Oliva
loating point constant value, or a vector constant value. */ @@ -233,6 +234,7 @@ struct GTY(()) dw_val_node { } GTY ((tag ("dw_val_class_vms_delta"))) val_vms_delta; dw_discr_value GTY ((tag ("dw_val_class_discr_value"))) val_discr_value; dw_discr_list_ref G

Re: [PR84620] output symbolic entry_view as data2, not addr

2018-03-09 Thread Alexandre Oliva
{ } GTY ((tag ("dw_val_class_vms_delta"))) val_vms_delta; dw_discr_value GTY ((tag ("dw_val_class_discr_value"))) val_discr_value; dw_discr_list_ref GTY ((tag ("dw_val_class_discr_list"))) val_discr_list; + char * GTY ((tag ("dw_val_c

[PR c++/84729] convert new init to array elt type

2018-03-10 Thread Alexandre Oliva
dg-warning "parenthesized initializer in array new|invalid conversion" } +} -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelis

[PR c++/84610,84642] recover from implicit template parms gracefully

2018-03-10 Thread Alexandre Oliva
r, decl_spec_token_start->location, input_location); + parser->auto_is_implicit_function_template_parm_p += saved_auto_is_implicit_function_template_parm_p; + return make_parameter_declarator (&decl_specifiers,

[PR c++/84647] undeclared fn called in auto default arg in ptr decl

2018-03-10 Thread Alexandre Oliva
+ b/gcc/testsuite/g++.dg/cpp0x/pr84647.C @@ -0,0 +1,3 @@ +// { dg-do compile { target c++11 } } + +void (*a)(auto b = c()); // { dg-error "parameter declaration|depend on a template|undeclared name|not declared|default arguments|typeless expression|implicit template" } -- Alexandre Oliva,

Re: [PR84682] disregard address constraints on non-addresses

2018-03-14 Thread Alexandre Oliva
s like an address, when you're part of the very code that's supposed to tell the rest of the compiler what a legitimate address should look like. -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free!

[PR c++/84789] do not resolve typename into template-independent

2018-03-16 Thread Alexandre Oliva
.C new file mode 100644 index ..bc1567f3fe77 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/pr84789.C @@ -0,0 +1,13 @@ +// { dg-do compile } + +struct A +{ + typedef int I; +}; + +template struct B : A {}; + +template struct C : B +{ + B::A::I::I i; // { dg-error "typename" } +};

[PR c++/71965] silence multi-dim array init sorry without tf_error

2018-03-17 Thread Alexandre Oliva
ldn't be a problem for this and +// similar cases. +Destructible() && requires (Args&&...args) { +new T{ (Args&&)args... }; +}; + +int main() { +using T = int[2][2]; +// GCC has not implemented initialization of multi-dimensional +// arrays

[PR c++/71251] out-of-range parms in tmpl arg substitution

2018-03-17 Thread Alexandre Oliva
plate struct S1; + +template struct S1>{ template struct S2:S2{}; }; // { dg-error "missing" } +//^ the error should be here, but it is^here, thus the weird line break -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in th

Re: [PR c++/71965] silence multi-dim array init sorry without tf_error

2018-03-17 Thread Alexandre Oliva
On Mar 17, 2018, Alexandre Oliva wrote: > We shouldn't substitute templates into short-circuited-out concepts > constraints, but we do, and to add insult to injury, we issue a > sorry() error when a concept that shouldn't even have been substituted > attempts to perform a m

Re: [PR c++/71251] out-of-range parms in tmpl arg substitution

2018-03-20 Thread Alexandre Oliva
On Mar 20, 2018, Jason Merrill wrote: > On Sat, Mar 17, 2018 at 8:13 AM, Alexandre Oliva wrote: >> As we go through each of the template parameters, substituting it with >> corresponding template arguments, an incorrect argument list might >> cause us to index argument vect

Re: [PATCH] [PR c++/71965] silence multi-dim array init sorry without tf_error

2018-03-20 Thread Alexandre Oliva
On Mar 20, 2018, Jason Merrill wrote: > On Sat, Mar 17, 2018 at 8:11 AM, Alexandre Oliva wrote: >> - sorry >> - ("cannot initialize multi-dimensional array with initializer"); > This shouldn't even be a sorry anymore > Let's make

Re: [PR c++/84729] convert new init to array elt type

2018-03-20 Thread Alexandre Oliva
On Mar 20, 2018, Jason Merrill wrote: > On Sat, Mar 10, 2018 at 6:57 AM, Alexandre Oliva wrote: >> A parenthesized initializer is only accepted when new()ing an array in >> permissive mode. We were not careful, however, to convert the >> TREE_LIST initializer to the array

Re: [PATCH] [PR c++/84610,84642] recover from implicit template parms gracefully

2018-03-20 Thread Alexandre Oliva
er->auto_is_implicit_function_template_parm_p, false); + (void)cleanup; + /* First, parse name of the attribute, a.k.a attribute-token. */ token = cp_lexer_peek_token (parser->lexer); -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in

Re: [PR c++/84789] do not resolve typename into template-independent

2018-03-20 Thread Alexandre Oliva
On Mar 20, 2018, Jason Merrill wrote: > On Fri, Mar 16, 2018 at 5:38 PM, Alexandre Oliva wrote: >> resolve_typename_type may peek into template types that might still be >> specialized. In some cases, e.g. g++.dg/template/friend48.C or >> g++.dg/template/decl2.C, that

Re: [PR c++/71251] out-of-range parms in tmpl arg substitution

2018-03-20 Thread Alexandre Oliva
On Mar 20, 2018, Jason Merrill wrote: > On Tue, Mar 20, 2018 at 4:15 PM, Alexandre Oliva wrote: >> Should we aim at rejecting the declaration of U? > Yes. Like this? [PR c++/71251] check tmpl parms in template using decl Check that template using decls have the correct number o

Re: [PR c++/71251] out-of-range parms in tmpl arg substitution

2018-03-20 Thread Alexandre Oliva
onsume tokens till the end of the declaration, but I figured we might as well try to parse them and see whether there were any other legitimate errors to report. -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandh

Re: [PR c++/84789] do not resolve typename into template-independent

2018-03-20 Thread Alexandre Oliva
On Mar 20, 2018, Jason Merrill wrote: > On Tue, Mar 20, 2018 at 6:07 PM, Alexandre Oliva wrote: >> On Mar 20, 2018, Jason Merrill wrote: >>> that doesn't mean it's wrong to peek. >> Huh? We're referencing members of an unrelated template that AFAIK >

Re: [PATCH] [PR c++/84610,84642] recover from implicit template parms gracefully

2018-03-21 Thread Alexandre Oliva
On Mar 20, 2018, Jason Merrill wrote: > On Tue, Mar 20, 2018 at 5:57 PM, Alexandre Oliva wrote: >> On Mar 20, 2018, Jason Merrill wrote: > Let's put this in cp-tree.h, with warning_sentinel. >> + (void)cleanup; > There are lots of RAII variables without this ex

Re: [PR c++/84729] convert new init to array elt type

2018-03-21 Thread Alexandre Oliva
uses GNU extensions, so disable -ansi #include @@ -13,5 +13,5 @@ public: main() { A* a; -a = new A[2](1,false); +a = new A[2](1,false); // { dg-error "parenthesized" } } -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer

Re: [PATCH] [PR c++/71965] silence multi-dim array init sorry without tf_error

2018-03-21 Thread Alexandre Oliva
sked not +// to issue errors, this shouldn't be a problem for this and +// similar cases. +Destructible() && requires (Args&&...args) { +new T{ (Args&&)args... }; +}; + +int main() { + using T = int[2][2]; +// GCC has not implemented initializ

Re: [PR c++/84789] do not resolve typename into template-independent

2018-03-21 Thread Alexandre Oliva
On Mar 21, 2018, Jason Merrill wrote: > On Tue, Mar 20, 2018 at 11:27 PM, Alexandre Oliva wrote: >> I understood you were saying it was ok to peek in this case. Would you >> please state, for clarity, what your stance is on peeking in this case, >> specifically, in the

[PATCH] [PR c++/84943] allow folding of array indexing indirect_ref

2018-03-22 Thread Alexandre Oliva
-pedantic-error default +// { dg-options "" } + +void a() { + a[0](); // { dg-warning "arithmetic" } +} -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF L

Re: [C++ PATCH] Fix FIX_TRUNC_EXPR instantiation (PR c++/84942)

2018-03-22 Thread Alexandre Oliva
ed with this, and only the latter one (linked to from PR84942), that I'm going to install tonight, affects this case. I didn't include the testcase in the patch assuming your testcase adn patch would go in, but it will certainly require adjustments for the expected error messages. --

Re: [PR c++/71251] out-of-range parms in tmpl arg substitution

2018-03-22 Thread Alexandre Oliva
On Mar 22, 2018, Jason Merrill wrote: > On Tue, Mar 20, 2018 at 10:29 PM, Alexandre Oliva wrote: >> On Mar 20, 2018, Jason Merrill wrote: >> >>>> + if (id == error_mark_node) >>>> +return error_mark_node; >> >>> Why wait unti

Re: [PR c++/71251] out-of-range parms in tmpl arg substitution

2018-03-22 Thread Alexandre Oliva
te template +using U = void; // { dg-error "too many" } + +template +using V = void; + +template struct X { + template template + using U = void; // { dg-error "too many" } + + template + using V = void; +}; -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ Y

[PATCH] [PR c++/84973] don't defer output of uninstantiated templates

2018-03-23 Thread Alexandre Oliva
} + +template void a() { + typedef struct { +void b() try { b; } catch (short) { +} + } c; +} -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Fr

[PATCH] [PR c++/84968] reject stmt-exprs in noexcept constexprs

2018-03-23 Thread Alexandre Oliva
; }))) // { dg-error "constant" } + { + } +}; -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer

Re: [PATCH] [PR c++/84943] allow folding of array indexing indirect_ref

2018-03-23 Thread Alexandre Oliva
On Mar 23, 2018, Jason Merrill wrote: > On Thu, Mar 22, 2018 at 7:00 PM, Alexandre Oliva wrote: >> fn[0]() ICEs because we end up with addr_expr of a decl, and that >> should only happen for artificial or otherwise special internal >> functions. For anything else, we

Re: [PR c++/84789] do not resolve typename into template-independent

2018-03-23 Thread Alexandre Oliva
in g++-dg.exp, or should I manually test these additional variants? Anyway, thanks for the report, I'll try to figure out why this fails with concepts. -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Fre

Re: [PR c++/84789] do not resolve typename into template-independent

2018-03-23 Thread Alexandre Oliva
late struct B : A {}; template struct C : B { - B::A::I::I i; // { dg-error "typename" } + B::A::I::I i; // { dg-error "not a class type|does not name a type|typename" } }; -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wis

[PATCH] [PR c++/84979] improve auto handling in explicit tmpl args for concepts

2018-03-23 Thread Alexandre Oliva
r() +{ + foo<0, auto>(bar); // { dg-bogus "unimplemented|no matching function" "" { xfail *-*-* } } +} diff --git a/gcc/testsuite/g++.dg/concepts/pr84979.C b/gcc/testsuite/g++.dg/concepts/pr84979.C new file mode 100644 index ..c70b3756f2b8 --- /dev/null +++ b

Re: [PATCH] [PR c++/84943] allow folding of array indexing indirect_ref

2018-03-23 Thread Alexandre Oliva
On Mar 23, 2018, Jason Merrill wrote: > On Thu, Mar 22, 2018 at 7:00 PM, Alexandre Oliva wrote: >> fn[0]() ICEs because we end up with addr_expr of a decl, and that >> should only happen for artificial or otherwise special internal >> functions. For anything else, we

Re: [PATCH] [PR c++/84943] allow folding of array indexing indirect_ref

2018-03-27 Thread Alexandre Oliva
finds when searching for a FUNCTION_DECL. Anyway, given the accumulated constraints I've been given WRT to this bug, I'm afraid I've run out of ideas. I welcome suggestions as to how to proceed. -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the

Re: [PATCH] [PR c++/84979] improve auto handling in explicit tmpl args for concepts

2018-03-28 Thread Alexandre Oliva
On Mar 23, 2018, Jason Merrill wrote: > On Fri, Mar 23, 2018 at 3:38 PM, Alexandre Oliva wrote: >> + /* Concepts allows 'auto' in template arguments, even multiple >> + 'auto's in a single argument. > I think that's only intended for class temp

Re: [PATCH] [PR c++/84979] improve auto handling in explicit tmpl args for concepts

2018-03-29 Thread Alexandre Oliva
On Mar 28, 2018, Jason Merrill wrote: > On Wed, Mar 28, 2018 at 5:06 AM, Alexandre Oliva wrote: >> On Mar 23, 2018, Jason Merrill wrote: >> >>> On Fri, Mar 23, 2018 at 3:38 PM, Alexandre Oliva wrote: >>>> + /* Concepts allows 'auto' in template

Re: [PATCH] [PR c++/84943] allow folding of array indexing indirect_ref

2018-03-29 Thread Alexandre Oliva
l depend on whether cp_build_addr_expr_1 gets called again after template substitution and overload resolution. -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board m

Re: [PATCH] [PR c++/84943] allow folding of array indexing indirect_ref

2018-03-29 Thread Alexandre Oliva
On Mar 29, 2018, Alexandre Oliva wrote: > On Mar 28, 2018, Jason Merrill wrote: >> It looks like cp_build_addr_expr_1 already calls mark_used for single >> static member functions, it should probably do the same for single >> non-member functions. > ultimately select,

Re: [PATCH] [PR c++/84943] allow folding of array indexing indirect_ref

2018-03-30 Thread Alexandre Oliva
On Mar 29, 2018, Alexandre Oliva wrote: > Here's a patch that should take care of the marking a namespace-scoped > or static member function as used when taking its address, thus working > around (fixing?) the reported problem. > Regstrapping now. Ok to install if it pass

[PATCH] [PR c++/85027] deal with baselink in save_expr in instantiate_type

2018-03-30 Thread Alexandre Oliva
027.C @@ -0,0 +1,8 @@ +// { dg-do compile } + +// Avoid -pedantic-error default +// { dg-options "" } + +struct A { static int a; }; + +int t = A::A ? : 0; // { dg-error "cannot resolve" } -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the chan

[PATCH] [PR c++/85039] no type definitions in builtin offsetof

2018-03-30 Thread Alexandre Oliva
ic d *b; +} * d::b(__builtin_offsetof(struct { // { dg-error "types may not be defined" } + int i; + struct a { // { dg-error "types may not be defined" } +int c() { return .1f; } + }; +}, i)); -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be

Re: [PATCH] [PR c++/84979] improve auto handling in explicit tmpl args for concepts

2018-03-30 Thread Alexandre Oliva
On Mar 30, 2018, Jason Merrill wrote: > On Thu, Mar 29, 2018 at 6:24 PM, Alexandre Oliva wrote: >> AFAICT we wouldn't always know, within cp_parser_template_id, whether >> the id is a type or a function. > True, it looks like sometimes we build a TEMPLATE_ID_EXPR wi

Re: [PATCH] [PR c++/84943] allow folding of array indexing indirect_ref

2018-03-30 Thread Alexandre Oliva
te/g++.dg/pr84943.C new file mode 100644 index ..36f75a164119 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr84943.C @@ -0,0 +1,8 @@ +// { dg-do compile } + +// Avoid -pedantic-error default +// { dg-options "" } + +void a() { + a[0](); // { dg-warning "arithmetic" } +

Re: [PATCH] [PR c++/84979] improve auto handling in explicit tmpl args for concepts

2018-03-31 Thread Alexandre Oliva
+void bar() +{ + foo(); // { dg-error "invalid|no match" } +} -- Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer

Re: [PATCH] [PR c++/85039] no type definitions in builtin offsetof

2018-03-31 Thread Alexandre Oliva
On Mar 30, 2018, Jason Merrill wrote: > On Fri, Mar 30, 2018 at 3:55 AM, Alexandre Oliva wrote: >> Types defined within a __builtin_offsetof argument don't always get >> properly recorded as members of their context types >> I suppose this means I should look for ano

Re: [PATCH] [PR c++/84943] allow folding of array indexing indirect_ref

2018-04-03 Thread Alexandre Oliva
On Apr 2, 2018, Jason Merrill wrote: > On Sat, Mar 31, 2018 at 2:24 AM, Alexandre Oliva wrote: >> On Mar 30, 2018, Jason Merrill wrote: >> >>> I don't think we need this; if arg is overloaded, we take the >>> type_unknown_p early exit, so the code l

Re: [PATCH] [PR c++/84979] improve auto handling in explicit tmpl args for concepts

2018-04-03 Thread Alexandre Oliva
On Apr 2, 2018, Jason Merrill wrote: > On Sat, Mar 31, 2018 at 4:23 AM, Alexandre Oliva wrote: >> On Mar 30, 2018, Jason Merrill wrote: >> template >> void foo(T t) { >> typename T::template C u = t; >> T::template C (t); >> T::template C:

Re: [PATCH] [PR c++/85039] no type definitions in builtin offsetof

2018-04-03 Thread Alexandre Oliva
On Apr 2, 2018, Jason Merrill wrote: > On Sat, Mar 31, 2018 at 7:12 AM, Alexandre Oliva wrote: >> struct a { >> static int const z, i = __builtin_offsetof(struct b { int j; }, j); >> b c; >> }; >> int const a::z = __builtin_offsetof(struct d { int k; }, k

Re: [PATCH] [PR c++/84979] improve auto handling in explicit tmpl args for concepts

2018-04-03 Thread Alexandre Oliva
On Apr 3, 2018, Jason Merrill wrote: > On Tue, Apr 3, 2018 at 3:54 AM, Alexandre Oliva wrote: >> On Apr 2, 2018, Jason Merrill wrote: >> >>> On Sat, Mar 31, 2018 at 4:23 AM, Alexandre Oliva wrote: >>>> On Mar 30, 2018, Jason Merrill wrote: >>>&

Re: [PATCH] [PR c++/84943] allow folding of array indexing indirect_ref

2018-04-03 Thread Alexandre Oliva
On Apr 3, 2018, Jason Merrill wrote: > On Tue, Apr 3, 2018 at 11:47 AM, Jason Merrill wrote: >> On Tue, Apr 3, 2018 at 3:44 AM, Alexandre Oliva wrote: >>> + if ((complain & tf_conv)) >>> +return false; >> I think we want to return true. Yeah, i

Re: [PATCH] [PR c++/85039] no type definitions in builtin offsetof

2018-04-03 Thread Alexandre Oliva
On Apr 3, 2018, Alexandre Oliva wrote: > On Apr 2, 2018, Jason Merrill wrote: >> On Sat, Mar 31, 2018 at 7:12 AM, Alexandre Oliva wrote: >>> struct a { >>> static int const z, i = __builtin_offsetof(struct b { int j; }, j); >>> b c; >>> }; >

Re: [PATCH] [PR c++/85039] no type definitions in builtin offsetof

2018-04-04 Thread Alexandre Oliva
On Apr 4, 2018, Jason Merrill wrote: > On Tue, Apr 3, 2018 at 11:25 PM, Alexandre Oliva wrote: >> I still think we could attempt to retain the extension as it is, parsing >> types introduced in data member initializers within the scope of the >> class containing the da

Re: [PATCH] [PR c++/84979] improve auto handling in explicit tmpl args for concepts

2018-04-04 Thread Alexandre Oliva
dg-error "yields a type" } +} + +struct T2 { + template struct C { +C(T2&); +static void f(T2&, C&); + }; + template static void D(T2&); +}; + +void f(T1& t1, T2& t2) { + foo1 (t2); + foo2 (t1); +} diff --git a/gcc/testsuite/g++.dg/concepts/pr84979.C b/gc

Re: [PATCH] [PR c++/85039] no type definitions in builtin offsetof

2018-04-13 Thread Alexandre Oliva
do compile } + +struct d { + static d *b; +} * d::b(__builtin_offsetof(struct { // { dg-error "types may not be defined" } + int i; + struct a { // { dg-error "types may not be defined" } +int c() { return .1f; } + }; +}, i)); -- Alexandre Oliva, freedom fighterhttp://

[PATCH] [PR c++/80290] recycle tinst garbage sooner

2018-04-13 Thread Alexandre Oliva
context at LOC for diagnostics and to restore it later. */ @@ -10096,6 +10108,9 @@ push_tinst_level_loc (tree tldcl, tree targs, location_t loc) && TREE_CODE (tldcl) != FUNCTION_DECL) fprintf (stderr, " %s", decl_as_string (tldcl, TFF_DECL_SPECIFIERS)); + if (!tin

[PR87054] fix unaligned access

2018-09-17 Thread Alexandre Oliva
PR middle-end/87054 * gimplify.c (gimplify_expr): Retain alignment of addressable lvalue in dereference. From: Alexandre Oliva for gcc/testsuite/ChangeLog PR middle-end/87054 * gcc.dg/pr87054.c: New. --- gcc/gimplify.c |8 +++- gcc/testsuite/gcc

[PR87013] check for .loc is_stmt support in the assembler

2018-09-17 Thread Alexandre Oliva
48c5037862254..55fcb7be4afa7 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -27931,8 +27931,10 @@ dwarf2out_source_line (unsigned int line, unsigned int column, if (is_stmt != table->is_stmt) { +#if HAVE_GAS_LOC_STMT fputs (" is_stmt ", asm_out_file); putc (is_stmt ? '1' : '0', asm_out_file); +#endif } if (SUPPORTS_DISCRIMINATOR && discriminator != 0) { -- Alexandre Oliva, freedom fighter https://FSFLA.org/blogs/lxo Be the change, be Free! FSF Latin America board member GNU Toolchain EngineerFree Software Evangelist

Re: [PR87054] fix unaligned access

2018-09-24 Thread Alexandre Oliva
2/-mno-sse. [PR87054] adjust testcase for 32-bit x86 From: Alexandre Oliva The test assumed __int128 to be available whenever __SSE__ was defined, but this assumption doesn't hold on 32-bit x86. Fixed. for gcc/testsuite/ChangeLog PR middle-end/87054 * gcc.dg/pr87054.c: Ad

adjust dinst.adb's expectations for location views

2018-09-25 Thread Alexandre Oliva
\[ \n]" } } */ +-- { dg-final { scan-assembler "loc \[0-9] 5 \[0-9]( is_stmt \[0-9])? discriminator 4\[ \n]" } } */ with DInst_Pkg; -- Alexandre Oliva, freedom fighter https://FSFLA.org/blogs/lxo Be the change, be Free! FSF Latin America board member GNU Toolchain EngineerFree Software Evangelist

Re: [Ada] Introduce -gnatd_A to set Opt.Disable_ALI_File

2018-09-27 Thread Alexandre Oliva
mpile From: Alexandre Oliva for gcc/ada/ChangeLog * gcc-interface/lang-specs.h (default_compilers): When given fcompare-debug-second, adjust auxbase like cc1, and pass gnatd_A. * gcc-interface/misc.c (flag_compare_debug): Remove variable. (gnat_post_optio

Re: [PATCH][2/n] Make _INLINE_ENTRY markers have the location we finally need

2018-10-01 Thread Alexandre Oliva
his move, and I'm sure any problem along these lines that arises, if any, can be fixed without much trouble. So, as far as I'm concerned, go for it, and thanks! -- Alexandre Oliva, freedom fighter https://FSFLA.org/blogs/lxo Be the change, be Free! FSF Latin America boa

<    4   5   6   7   8   9   10   11   12   13   >