[Bug rtl-optimization/66166] wrong code at -O1 and above on x86_64-linux-gnu

2015-05-16 Thread su at cs dot ucdavis.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66166

--- Comment #4 from Zhendong Su  ---
Oh yes, that's correct. Sorry for the invalid report.


[Bug target/66140] ICE at extract_insn, at recog.c:2343 when compiling for alpha with gcc-5.1.1

2015-05-16 Thread uros at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66140

--- Comment #4 from uros at gcc dot gnu.org ---
Author: uros
Date: Sat May 16 07:28:16 2015
New Revision: 223232

URL: https://gcc.gnu.org/viewcvs?rev=223232&root=gcc&view=rev
Log:
PR target/66140
* config/alpha/alpha.c (get_aligned_mem): Also look for reload
replacements in memory addresses.
(get_unaligned_address): Ditto.

testsuite/ChangeLog:

PR target/66140
* gcc.target/alpha/pr66140.c: New test.


Added:
trunk/gcc/testsuite/gcc.target/alpha/pr66140.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/alpha/alpha.c
trunk/gcc/testsuite/ChangeLog


[Bug target/66140] ICE at extract_insn, at recog.c:2343 when compiling for alpha with gcc-5.1.1

2015-05-16 Thread uros at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66140

--- Comment #5 from uros at gcc dot gnu.org ---
Author: uros
Date: Sat May 16 07:42:20 2015
New Revision: 223233

URL: https://gcc.gnu.org/viewcvs?rev=223233&root=gcc&view=rev
Log:
PR target/66140
* config/alpha/alpha.c (get_aligned_mem): Also look for reload
replacements in memory addresses.
(get_unaligned_address): Ditto.

testsuite/ChangeLog:

PR target/66140
* gcc.target/alpha/pr66140.c: New test.


Added:
branches/gcc-5-branch/gcc/testsuite/gcc.target/alpha/pr66140.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/config/alpha/alpha.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog


[Bug tree-optimization/66163] [6 Regression] Not working Firefox built with LTO

2015-05-16 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66163

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #4 from Marek Polacek  ---
-fsanitize=null should do exactly that.


[Bug target/63810] gcc sets incorrect macro for OS X deployment targets

2015-05-16 Thread fxcoudert at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63810

--- Comment #24 from Francois-Xavier Coudert  ---
(In reply to Lawrence Velázquez from comment #23)
> I don't see anything in version_as_legacy_macro() that specifically deals
> with major <= 9. Could you point me to the offending code?

In the comment above it ("Major numbers are zero-padded if necessary"), and the
sprintf format "%02lu%lu%lu" (which can be "%lu%lu%lu").

[Bug fortran/65792] allocation of scalar elemental function with structure constructor fails

2015-05-16 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65792

--- Comment #9 from Paul Thomas  ---
Author: pault
Date: Sat May 16 08:09:52 2015
New Revision: 223234

URL: https://gcc.gnu.org/viewcvs?rev=223234&root=gcc&view=rev
Log:
2015-05-16  Mikael Morin  

PR fortran/65792
* trans-expr.c (gfc_trans_subcomponent_assign): Always assign
the expression component to the destination. In addition, if
the component has allocatable components, copy them and
deallocate those of the expression, if it is not a variable.
The expression is fixed if not a variable to prevent multiple
evaluations.

2015-05-16  Mikael Morin  

PR fortran/65792
* gfortran.dg/derived_constructor_components_5: New test

Added:
trunk/gcc/testsuite/gfortran.dg/derived_constructor_comps_5.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-expr.c
trunk/gcc/testsuite/ChangeLog


[Bug fortran/66079] [6 Regression] memory leak with source allocation in internal subprogram

2015-05-16 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66079

Paul Thomas  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-05-16
 CC||pault at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |pault at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Paul Thomas  ---
Hi Damian,

The reason for this memory leak is rather obvious:

newrealvec ()
{
  struct subdata * d;

  try
{
  d = 0B;
  {
struct subdata D.3386;
struct subdata D.3385;
struct subdata subdata.0;

subdata.0.b = (integer(kind=4) *) __builtin_malloc (4);
*subdata.0.b = 0;
D.3385 = subdata.0;
D.3386 = D.3385;
if (d != 0B)
  {
_gfortran_runtime_error_at (&"At line 10 of file
pr66079.f90"[1]{lb: 1 sz: 1}, &"Attempting to allocate already allocated
variable \'%s\'"[1]{lb: 1 sz: 1}, &"d"[1]{lb: 1 sz: 1});
  }
else
  {
d = (struct subdata *) __builtin_malloc (8);
if (d == 0B)
  {
_gfortran_os_error (&"Allocation would exceed memory
limit"[1]{lb: 1 sz: 1});
  }
  }
d->b = 0B;
{
  struct subdata subdata.1;

  subdata.1.b = (integer(kind=4) *) __builtin_malloc (4);
  *subdata.1.b = 0;
  *d = subdata.1;
}
  }
}
  finally
{
  if (d != 0B)
{
  if (d->b != 0B)
{
  __builtin_free ((void *) d->b);
}
  d->b = 0B;
  __builtin_free ((void *) d);
}
}
}

subdata.1 gets freed in the finally block but subdata.0, which is redundant in
any case, does not.

Confirmed - thanks for the report I just have to find out why it is we wind
up with two subdata's.

Cheers

Paul


[Bug tree-optimization/14741] graphite with loop blocking and interchanging doesn't optimize a matrix multiplication loop

2015-05-16 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14741

--- Comment #31 from Thomas Koenig  ---
If the middle end is not up to this, should we be looking at doing loop
blocking in the Fortran front end, at least for the Matmul intrinsic?


[Bug target/65768] sub-optimimal code for constant Uses in loop

2015-05-16 Thread kugan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65768

--- Comment #2 from kugan at gcc dot gnu.org ---
Author: kugan
Date: Sat May 16 09:35:52 2015
New Revision: 223235

URL: https://gcc.gnu.org/viewcvs?rev=223235&root=gcc&view=rev
Log:
gcc/ChangeLog:

2015-05-16  Kugan Vivekanandarajah  
Zhenqiang Chen  

PR target/65768
* config/arm/arm.h (DONT_EARLY_SPLIT_CONSTANT): New macro.
* config/arm/arm.md (subsi3, andsi3, iorsi3, xorsi3, movsi): Keep some
 large constants in register instead of splitting them.

gcc/testsuite/ChangeLog:

2015-05-16  Kugan Vivekanandarajah  
Zhenqiang Chen  

PR target/65768
* gcc.target/arm/maskdata.c: New test.


Added:
trunk/gcc/testsuite/gcc.target/arm/maskdata.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/arm/arm.h
trunk/gcc/config/arm/arm.md
trunk/gcc/testsuite/ChangeLog


[Bug fortran/60392] Problem with TRANSPOSE and CONTIGUOUS dummy arguments

2015-05-16 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60392

Thomas Koenig  changed:

   What|Removed |Added

 CC||tkoenig at gcc dot gnu.org
  Known to work|4.10.0  |5.0

--- Comment #11 from Thomas Koenig  ---
I don't think backporting to 4.8 is necessary any more.

Time to close?


[Bug fortran/60392] Problem with TRANSPOSE and CONTIGUOUS dummy arguments

2015-05-16 Thread a.vogt at fulguritus dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60392

Alexander Vogt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #12 from Alexander Vogt  ---
I don't think that is necessary... Thanks anyway!


[Bug ada/66162] Bug box compiling Ada.Finalization with -gnatc

2015-05-16 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66162

Eric Botcazou  changed:

   What|Removed |Added

 Status|UNCONFIRMED |SUSPENDED
   Last reconfirmed||2015-05-16
 CC||ebotcazou at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Eric Botcazou  ---
Why on Earth are you doing this?  No plan to look into it.


[Bug fortran/66175] New: ICE in gfc_free_namespace with unbalanced BLOCKs

2015-05-16 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66175

Bug ID: 66175
   Summary: ICE in gfc_free_namespace with unbalanced BLOCKs
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tkoenig at gcc dot gnu.org
  Target Milestone: ---

ig25@linux-fd1f:~/Krempel/Block> cat ice.f90
program main
  integer :: n
  n = 3
  block
block
  print *,n
end program main
ig25@linux-fd1f:~/Krempel/Block> gfortran ice.f90
ice.f90:7:3:

 end program main
   1
Error: Expecting END BLOCK statement at (1)
f951: Error: Unexpected end of file in »ice.f90«
f951: internal compiler error: in gfc_free_namespace, bei fortran/symbol.c:3525
0x6b2f07 gfc_free_namespace(gfc_namespace*)
../../trunk/gcc/fortran/symbol.c:3525
0x6ad2d3 gfc_free_statement(gfc_code*)
../../trunk/gcc/fortran/st.c:124
0x6ad3c9 gfc_free_statements(gfc_code*)
../../trunk/gcc/fortran/st.c:272
0x6b2dc8 gfc_free_namespace(gfc_namespace*)
../../trunk/gcc/fortran/symbol.c:3527
0x6b33dc gfc_symbol_done_2()
../../trunk/gcc/fortran/symbol.c:3573
0x663b88 gfc_done_2()
../../trunk/gcc/fortran/misc.c:258
0x677ab5 unexpected_eof
../../trunk/gcc/fortran/parse.c:2463
0x67eb24 parse_critical_block
../../trunk/gcc/fortran/parse.c:3845
0x67eb24 parse_executable
../../trunk/gcc/fortran/parse.c:4671
0x67fb16 parse_progunit
../../trunk/gcc/fortran/parse.c:4978
0x67ef33 parse_block_construct
../../trunk/gcc/fortran/parse.c:3931
0x67ef33 parse_executable
../../trunk/gcc/fortran/parse.c:4645
0x67fb16 parse_progunit
../../trunk/gcc/fortran/parse.c:4978
0x67ef33 parse_block_construct
../../trunk/gcc/fortran/parse.c:3931
0x67ef33 parse_executable
../../trunk/gcc/fortran/parse.c:4645
0x67fb16 parse_progunit
../../trunk/gcc/fortran/parse.c:4978
0x681267 gfc_parse_file()
../../trunk/gcc/fortran/parse.c:5426
0x6c1535 gfc_be_parse_file
../../trunk/gcc/fortran/f95-lang.c:228

[Bug fortran/66040] ICE on misplaced sequence in function

2015-05-16 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66040

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-05-16
 Ever confirmed|0   |1

--- Comment #4 from Dominique d'Humieres  ---
Patch posted at https://gcc.gnu.org/ml/fortran/2015-05/msg00081.html.


[Bug rtl-optimization/66168] [6 Regression] ICE at -O3 in elimination_costs_in_insn, at reload1.c:3677

2015-05-16 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66168

H.J. Lu  changed:

   What|Removed |Added

   Target Milestone|--- |6.0
Summary|ICE at -O3 in   |[6 Regression] ICE at -O3
   |elimination_costs_in_insn,  |in
   |at reload1.c:3677   |elimination_costs_in_insn,
   ||at reload1.c:3677


[Bug fortran/66176] New: Handle conjg() in inline matmul

2015-05-16 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66176

Bug ID: 66176
   Summary: Handle conjg() in inline matmul
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tkoenig at gcc dot gnu.org
  Target Milestone: ---

Handle conjg() for inline matmul, such as

   c = matmul(conjg(a),b)
   c = matmul(a, conjg(b))


[Bug fortran/44054] Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color

2015-05-16 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44054

--- Comment #24 from Manuel López-Ibáñez  ---
Author: manu
Date: Sat May 16 12:30:04 2015
New Revision: 223236

URL: https://gcc.gnu.org/viewcvs?rev=223236&root=gcc&view=rev
Log:
gcc/fortran/ChangeLog:

2015-05-16  Manuel López-Ibáñez  

PR fortran/44054

Replace all calls to gfc_notify_std_1 with gfc_notify_std and
gfc_warning_1 with gfc_warning.
* decl.c (gfc_verify_c_interop_param): Here.
* resolve.c (resolve_branch): Here.
(resolve_fl_derived): Here.
* dependency.c (gfc_check_argument_var_dependency):
* scanner.c (preprocessor_line): Use gfc_warning_now_at. Fix line
counter and locations before and after warning.
* gfortran.h (gfc_warning_1, gfc_warning_now_1, gfc_notify_std_1):
Delete.
(gfc_warning_now_at): Declare.
* error.c (gfc_warning_1): Delete.
(gfc_notify_std_1): Delete.
(gfc_warning_now_1): Delete.
(gfc_format_decoder): Handle two locations.
(gfc_diagnostic_build_prefix): Rename as
gfc_diagnostic_build_kind_prefix.
(gfc_diagnostic_build_locus_prefix): Take an expanded_location
instead of diagnostic_info.
(gfc_diagnostic_build_locus_prefix): Add overload that takes two
expanded_location.
(gfc_diagnostic_starter): Handle two locations.
(gfc_warning_now_at): New.
(gfc_diagnostics_init): Initialize caret_chars array.
(gfc_diagnostics_finish): Reset caret_chars array to default.

gcc/cp/ChangeLog:

2015-05-16  Manuel López-Ibáñez  

PR fortran/44054
* error.c (cp_diagnostic_starter): Use diagnostic_location
function.
(cp_print_error_function): Likewise.
(cp_printer): Replace locus pointer with accessor function.

gcc/c/ChangeLog:

2015-05-16  Manuel López-Ibáñez  

PR fortran/44054
* c-objc-common.c (c_tree_printer): Replace locus pointer with
accessor function.

gcc/ChangeLog:

2015-05-16  Manuel López-Ibáñez  

PR fortran/44054
* tree-pretty-print.c (percent_K_format): Replace locus pointer
with accessor function.
* tree-diagnostic.c (diagnostic_report_current_function): Use
diagnostic_location function.
(maybe_unwind_expanded_macro_loc): Likewise.
(virt_loc_aware_diagnostic_finalizer): Likewise.
(default_tree_printer): Replace locus pointer with accessor function.
* diagnostic.c (diagnostic_initialize): Initialize caret_chars array.
(diagnostic_set_info_translated): Initialize second location.
(diagnostic_build_prefix): Use CARET_LINE_MARGIN.
(diagnostic_show_locus): Handle two locations. Call
diagnostic_print_caret_line.
(diagnostic_print_caret_line): New.
(default_diagnostic_starter): Use diagnostic_location function.
(diagnostic_report_diagnostic): Use diagnostic_location function.
(verbatim): Do not set text.locus.
* diagnostic.h (struct diagnostic_info): Remove location field.
(struct diagnostic_context): Make caret_chars an array of two.
(diagnostic_location): New inline.
(diagnostic_expand_location): Handle two locations.
(diagnostic_same_line): New inline.
(diagnostic_print_caret_line): Declare.
(CARET_LINE_MARGIN): New constant.
* pretty-print.c (pp_printf): Do not set text.locus.
(pp_verbatim): Do not set text.locus.
* pretty-print.h (MAX_LOCATIONS_PER_MESSAGE): New constant.
(struct text_info): Replace locus pointer with locations
array. Add accessor functions.

gcc/testsuite/ChangeLog:

2015-05-16  Manuel López-Ibáñez  

PR fortran/44054
* lib/gfortran-dg.exp: Update regex to handle two locations for
the same diagnostic without caret.
* gfortran.dg/badline.f: Test also that line numbers are correct
before and after "left but not entered" warning.



Modified:
trunk/gcc/ChangeLog
trunk/gcc/c/ChangeLog
trunk/gcc/cp/ChangeLog
trunk/gcc/fortran/ChangeLog
trunk/gcc/testsuite/ChangeLog

[Bug fortran/44054] Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color

2015-05-16 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44054

--- Comment #25 from Manuel López-Ibáñez  ---
Author: manu
Date: Sat May 16 12:31:00 2015
New Revision: 223237

URL: https://gcc.gnu.org/viewcvs?rev=223237&root=gcc&view=rev
Log:
gcc/fortran/ChangeLog:

2015-05-16  Manuel López-Ibáñez  

PR fortran/44054

Replace all calls to gfc_notify_std_1 with gfc_notify_std and
gfc_warning_1 with gfc_warning.
* decl.c (gfc_verify_c_interop_param): Here.
* resolve.c (resolve_branch): Here.
(resolve_fl_derived): Here.
* dependency.c (gfc_check_argument_var_dependency):
* scanner.c (preprocessor_line): Use gfc_warning_now_at. Fix line
counter and locations before and after warning.
* gfortran.h (gfc_warning_1, gfc_warning_now_1, gfc_notify_std_1):
Delete.
(gfc_warning_now_at): Declare.
* error.c (gfc_warning_1): Delete.
(gfc_notify_std_1): Delete.
(gfc_warning_now_1): Delete.
(gfc_format_decoder): Handle two locations.
(gfc_diagnostic_build_prefix): Rename as
gfc_diagnostic_build_kind_prefix.
(gfc_diagnostic_build_locus_prefix): Take an expanded_location
instead of diagnostic_info.
(gfc_diagnostic_build_locus_prefix): Add overload that takes two
expanded_location.
(gfc_diagnostic_starter): Handle two locations.
(gfc_warning_now_at): New.
(gfc_diagnostics_init): Initialize caret_chars array.
(gfc_diagnostics_finish): Reset caret_chars array to default.

gcc/cp/ChangeLog:

2015-05-16  Manuel López-Ibáñez  

PR fortran/44054
* error.c (cp_diagnostic_starter): Use diagnostic_location
function.
(cp_print_error_function): Likewise.
(cp_printer): Replace locus pointer with accessor function.

gcc/c/ChangeLog:

2015-05-16  Manuel López-Ibáñez  

PR fortran/44054
* c-objc-common.c (c_tree_printer): Replace locus pointer with
accessor function.

gcc/ChangeLog:

2015-05-16  Manuel López-Ibáñez  

PR fortran/44054
* tree-pretty-print.c (percent_K_format): Replace locus pointer
with accessor function.
* tree-diagnostic.c (diagnostic_report_current_function): Use
diagnostic_location function.
(maybe_unwind_expanded_macro_loc): Likewise.
(virt_loc_aware_diagnostic_finalizer): Likewise.
(default_tree_printer): Replace locus pointer with accessor function.
* diagnostic.c (diagnostic_initialize): Initialize caret_chars array.
(diagnostic_set_info_translated): Initialize second location.
(diagnostic_build_prefix): Use CARET_LINE_MARGIN.
(diagnostic_show_locus): Handle two locations. Call
diagnostic_print_caret_line.
(diagnostic_print_caret_line): New.
(default_diagnostic_starter): Use diagnostic_location function.
(diagnostic_report_diagnostic): Use diagnostic_location function.
(verbatim): Do not set text.locus.
* diagnostic.h (struct diagnostic_info): Remove location field.
(struct diagnostic_context): Make caret_chars an array of two.
(diagnostic_location): New inline.
(diagnostic_expand_location): Handle two locations.
(diagnostic_same_line): New inline.
(diagnostic_print_caret_line): Declare.
(CARET_LINE_MARGIN): New constant.
* pretty-print.c (pp_printf): Do not set text.locus.
(pp_verbatim): Do not set text.locus.
* pretty-print.h (MAX_LOCATIONS_PER_MESSAGE): New constant.
(struct text_info): Replace locus pointer with locations
array. Add accessor functions.

gcc/testsuite/ChangeLog:

2015-05-16  Manuel López-Ibáñez  

PR fortran/44054
* lib/gfortran-dg.exp: Update regex to handle two locations for
the same diagnostic without caret.
* gfortran.dg/badline.f: Test also that line numbers are correct
before and after "left but not entered" warning.



Modified:
trunk/gcc/c/c-objc-common.c
trunk/gcc/cp/error.c
trunk/gcc/diagnostic.c
trunk/gcc/diagnostic.h
trunk/gcc/fortran/decl.c
trunk/gcc/fortran/dependency.c
trunk/gcc/fortran/error.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/resolve.c
trunk/gcc/fortran/scanner.c
trunk/gcc/pretty-print.c
trunk/gcc/pretty-print.h
trunk/gcc/testsuite/gfortran.dg/badline.f
trunk/gcc/testsuite/lib/gfortran-dg.exp
trunk/gcc/tree-diagnostic.c
trunk/gcc/tree-pretty-print.c

[Bug fortran/66113] Variable n cannot appear in the expression with nested blocks

2015-05-16 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66113

--- Comment #5 from Thomas Koenig  ---
Author: tkoenig
Date: Sat May 16 12:33:01 2015
New Revision: 223238

URL: https://gcc.gnu.org/viewcvs?rev=223238&root=gcc&view=rev
Log:
2015-05-16  Thomas Koenig  

PR fortran/66113
* expr.c (is_parent_of_current_ns):  New function.
(check_restricted):  Use it.

2015-05-16  Thomas Koenig  

PR fortran/66113
* gfortran.dg/block_14.f90:  New test.


Added:
trunk/gcc/testsuite/gfortran.dg/block_14.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/testsuite/ChangeLog


[Bug fortran/48997] Don't use allocatable arrays for function elimination

2015-05-16 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48997
Bug 48997 depends on bug 66113, which changed state.

Bug 66113 Summary: Variable n cannot appear in the expression with nested blocks
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66113

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED


[Bug fortran/66113] Variable n cannot appear in the expression with nested blocks

2015-05-16 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66113

Thomas Koenig  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Thomas Koenig  ---
Fixed on trunk, closing.


[Bug c++/66177] New: warn_unused_result doesn't always work

2015-05-16 Thread gcc at bobbyperu dot info
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66177

Bug ID: 66177
   Summary: warn_unused_result doesn't always work
   Product: gcc
   Version: 4.9.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gcc at bobbyperu dot info
  Target Milestone: ---

Testcase fails to work with gcc, works with clang.

=
struct QSize
{
QSize(int w, int h) : wd(w), ht(h) {}

QSize expandedTo() const __attribute__ ((__warn_unused_result__))
{
return QSize(2, 3);
}

private:
int wd;
int ht;
};

void foo()
{
QSize sz(2, 2);
sz.expandedTo();
}
=
$ g++ testcase.cpp -c -Wunused-result

$ clang++ testcase.cpp -c -Wunused-result
testcase.cpp:18:5: warning: ignoring return value of function declared with
warn_unused_result attribute [-Wunused-result]
sz.expandedTo();
^
1 warning generated.


[Bug c++/66177] warn_unused_result doesn't always work

2015-05-16 Thread gcc at bobbyperu dot info
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66177

--- Comment #1 from Sergio Martins  ---
It this is known, at least please mention in the documentation it only works
for built-in types.


[Bug fortran/66079] [6 Regression] memory leak with source allocation in internal subprogram

2015-05-16 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66079

--- Comment #2 from Paul Thomas  ---
Created attachment 3
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3&action=edit
Initial fix

This is a partial fix, in that it deals with the initial problem.

  type subdata
integer, allocatable :: b
  endtype
  block
call newRealVec
  end block
contains
  subroutine newRealVec
type(subdata), allocatable :: d, e, f
allocate(d,source=subdata(1)) ! was lost, now OK
allocate(e,source=d) ! OK
allocate(f,source=create (99)) ! 8 bytes go AWOL
if (d%b .ne. 1) call abort
if (e%b .ne. 1) call abort
if (f%b .ne. 99) call abort
f = create (42) ! another 8 bytes go AWOL
print *, f%b
  end subroutine
  function create (arg) result(res)
integer :: arg
type(subdata), allocatable :: res
allocate(res, source = subdata(arg))
  end function
end

The function calls are losing the allocation for the subdata type itself. The b
component is correctly dealt with. I know what has to be done to fix this.

Arrays are a mess.

allocate (d(2), source = subdata ()) ICEs on a double free
allocate (d(2), source = [subdata (1), subdata (2)]) loses 8 bytes in two
chunks.

Watch this space.

Paul


[Bug target/66174] [6 Regression] ICE: in extract_insn, at recog.c:2341 (unrecognizable insns) with -ftree-vectorize -mavx512ifma

2015-05-16 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66174

Uroš Bizjak  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-05-16
 CC||kyukhin at gcc dot gnu.org
   Target Milestone|--- |6.0
 Ever confirmed|0   |1

--- Comment #1 from Uroš Bizjak  ---
Confirmed, adding CC.

[Bug target/66174] [6 Regression] ICE: in extract_insn, at recog.c:2341 (unrecognizable insns) with -ftree-vectorize -mavx512ifma

2015-05-16 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66174

--- Comment #2 from Uroš Bizjak  ---
(In reply to Uroš Bizjak from comment #1)
> Confirmed, adding CC.

Also fails with -O -ftree-vectorize -mavx512f.

[Bug target/66174] [6 Regression] ICE: in extract_insn, at recog.c:2341 (unrecognizable insns) with -ftree-vectorize -mavx512ifma

2015-05-16 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66174

--- Comment #3 from Uroš Bizjak  ---
The problem is in i386.c, function expand_vec_perm_blend, where:

  /* This matches five different patterns with the different modes.  */
  x = gen_rtx_VEC_MERGE (vmode, op1, op0, GEN_INT (mask));
  x = gen_rtx_SET (target, x);
  emit_insn (x);

AVX512F modes need to move mask to a mask register.

[Bug target/66174] [6 Regression] ICE: in extract_insn, at recog.c:2341 (unrecognizable insns) with -ftree-vectorize -mavx512ifma

2015-05-16 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66174

--- Comment #4 from Uroš Bizjak  ---
Untested patch:

--cut here--
Index: i386.c
===
--- i386.c  (revision 223231)
+++ i386.c  (working copy)
@@ -46780,12 +46780,14 @@ expand_vec_perm_blend (struct expand_vec_perm_d *d
   machine_mode vmode = d->vmode;
   unsigned i, mask, nelt = d->nelt;
   rtx target, op0, op1, x;
+  rtx maskop;
   rtx rperm[32], vperm;

   if (d->one_operand_p)
 return false;
   if (TARGET_AVX512F && GET_MODE_SIZE (vmode) == 64
-  && GET_MODE_SIZE (GET_MODE_INNER (vmode)) >= 4)
+  && (TARGET_AVX512BW
+ || GET_MODE_SIZE (GET_MODE_INNER (vmode)) >= 4))
 ;
   else if (TARGET_AVX2 && GET_MODE_SIZE (vmode) == 32)
 ;
@@ -46959,8 +46961,28 @@ expand_vec_perm_blend (struct expand_vec_perm_d *d
   gcc_unreachable ();
 }

+  switch (vmode)
+{
+case V8DFmode:
+case V8DImode:
+  maskop = force_reg (QImode, gen_int_mode (mask, QImode));
+  break;
+case V16SFmode:
+case V16SImode:
+  maskop = force_reg (HImode, gen_int_mode (mask, HImode));
+  break;
+case V32HImode:
+  maskop = force_reg (SImode, gen_int_mode (mask, SImode));
+  break;
+case V64QImode:
+  maskop = force_reg (DImode, gen_int_mode (mask, DImode));
+  break;
+default:
+  maskop = GEN_INT (mask);
+}
+
   /* This matches five different patterns with the different modes.  */
-  x = gen_rtx_VEC_MERGE (vmode, op1, op0, GEN_INT (mask));
+  x = gen_rtx_VEC_MERGE (vmode, op1, op0, maskop);
   x = gen_rtx_SET (target, x);
   emit_insn (x);
   if (target != d->target)
--cut here--

[Bug fortran/65903] [5/6 Regression] Line continuation followed by comment character in string fails to compile

2015-05-16 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65903

--- Comment #6 from Jerry DeLisle  ---
Author: jvdelisle
Date: Sat May 16 17:44:15 2015
New Revision: 223248

URL: https://gcc.gnu.org/viewcvs?rev=223248&root=gcc&view=rev
Log:
2015-05-16  Jerry DeLisle  

PR fortran/65903
* io.c (format_lex): Change to NONSTRING when checking for
possible doubled quote.
* scanner.c (gfc_next_char_literal): Revert change from 64506
and add a check for quotes and return.

Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/io.c
trunk/gcc/fortran/scanner.c


[Bug fortran/65903] [5/6 Regression] Line continuation followed by comment character in string fails to compile

2015-05-16 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65903

--- Comment #7 from Jerry DeLisle  ---
Author: jvdelisle
Date: Sat May 16 17:51:41 2015
New Revision: 223249

URL: https://gcc.gnu.org/viewcvs?rev=223249&root=gcc&view=rev
Log:
2015-05-16  Jerry DeLisle  

PR fortran/65903
* gfortran.dg/continuation_13.f90: Update test.
* gfortran.dg/pr65903.f90: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/pr65903.f90
Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/continuation_13.f90


[Bug rtl-optimization/30967] Extra sign/zero extend with word comparison result

2015-05-16 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30967

--- Comment #6 from Segher Boessenkool  ---
Author: segher
Date: Sat May 16 17:56:55 2015
New Revision: 223250

URL: https://gcc.gnu.org/viewcvs?rev=223250&root=gcc&view=rev
Log:
Backport from mainline
2015-05-13  Segher Boessenkool  

PR rtl-optimization/30967
* config/rs6000/rs6000.c (rs6000_rtx_costs): Don't consider
destination mode for the cost of scc patterns.

Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/config/rs6000/rs6000.c


[Bug tree-optimization/66178] New: Another label as values ICE

2015-05-16 Thread SztfG at yandex dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66178

Bug ID: 66178
   Summary: Another label as values ICE
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: SztfG at yandex dot ru
  Target Milestone: ---

c and c++ compiler crashes. Testcase:

void bar(int);

int test(void) {
static int test =  ((char *)&&l2-(char *)&&l3)+((char *)&&l1-(char *)&&l2);
l1:
l2:
l3:
bar(test);
return 0;
}


[Bug tree-optimization/66178] Another label as values ICE

2015-05-16 Thread SztfG at yandex dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66178

--- Comment #1 from SztfG at yandex dot ru ---
better test case

int test(void)
{
static int a =  ((char *)&&l2-(char *)&&l3)+((char *)&&l1-(char *)&&l2);
l1:
l2:
l3:
return a;
}


[Bug tree-optimization/66178] Another label as values ICE

2015-05-16 Thread SztfG at yandex dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66178

--- Comment #2 from SztfG at yandex dot ru ---
another testcase:

int test(void)
{
static int a =  ((char *)&&l1-(char *)&&l2)-1;
l1:
l2:
return a;
}


[Bug ada/66167] Scalar Storage Order attribute has no effect on 2 dimensional arrays

2015-05-16 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66167

--- Comment #3 from Eric Botcazou  ---
Author: ebotcazou
Date: Sat May 16 20:15:01 2015
New Revision: 223251

URL: https://gcc.gnu.org/viewcvs?rev=223251&root=gcc&view=rev
Log:
PR ada/66167
ada/
* gcc-interface/decl.c (gnat_to_gnu_entity) : Set
TYPE_REVERSE_STORAGE_ORDER on the innermost array.
: Likewise.
testsuite/
* gnat.dg/sso/init12.ads: New helper.
* gnat.dg/sso/p12.adb: New test.
* gnat.dg/sso/q12.adb: Likewise.
* gnat.dg/sso/r12.adb: Likewise.
* gnat.dg/sso/s12.adb: Likewise.
* gnat.dg/sso/t12.adb: Likewise.

Added:
branches/scalar-storage-order/gcc/testsuite/gnat.dg/sso/init12.ads
branches/scalar-storage-order/gcc/testsuite/gnat.dg/sso/p12.adb
branches/scalar-storage-order/gcc/testsuite/gnat.dg/sso/q12.adb
branches/scalar-storage-order/gcc/testsuite/gnat.dg/sso/r12.adb
branches/scalar-storage-order/gcc/testsuite/gnat.dg/sso/s12.adb
branches/scalar-storage-order/gcc/testsuite/gnat.dg/sso/t12.adb
Modified:
branches/scalar-storage-order/gcc/ada/gcc-interface/decl.c


[Bug ada/66167] Scalar Storage Order attribute has no effect on 2 dimensional arrays

2015-05-16 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66167

Eric Botcazou  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |6.0

--- Comment #4 from Eric Botcazou  ---
Fixed on the branch.


[Bug tree-optimization/66123] [4.8/4.9/5 Regression] Array of labels as values + ternary operator + pointer arithmetic = internal compiler error

2015-05-16 Thread SztfG at yandex dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66123

--- Comment #7 from SztfG at yandex dot ru ---
Similar bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66178


[Bug tree-optimization/66163] [6 Regression] Not working Firefox built with LTO

2015-05-16 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66163

Jan Hubicka  changed:

   What|Removed |Added

 CC||law at redhat dot com

--- Comment #5 from Jan Hubicka  ---
Hmm, interesting.  I tried a testcase:
$ more t.C
struct test {int a; int foo (int &b);};
int
test2 (test *t, int *q)
{
  if (t && q)
return t->a+*q;
  else
return 1;
}
int test::foo(int &b)
{
  return test2(this,&b);
}

compiled with -O3 -fsanitize=null.  I would expect test2 to have no sanitizer
checks (since it returns 1 at NULL) and test to have them.

Curiously enough test2 gets compiled as:
int test2(test*, int*) (struct test * t, int * q)
{
  int _1;
  bool _3;
  bool _5;
  bool _6;
  int _8;
  int _9;
  int _10;

  :
  _3 = t_2(D) != 0B;
  _5 = q_4(D) != 0B;
  _6 = _3 & _5;
  if (_6 != 0)
goto ;
  else
goto ;

  :
  if (t_2(D) == 0B)
goto ;
  else
goto ;

  :
  __builtin___ubsan_handle_type_mismatch (&*.Lubsan_data0, 0);

  :
  _8 = t_2(D)->a;
  if (q_4(D) == 0B)
goto ;
  else
goto ;

  :
  __builtin___ubsan_handle_type_mismatch (&*.Lubsan_data1, 0);

  :
  _9 = *q_4(D);
  _10 = _8 + _9;

  :
  # _1 = PHI <_10(7), 1(2)>
  return _1;

}

Why we do not simplify the checks here?
  _3 = t_2(D) != 0B;
  _5 = q_4(D) != 0B;
  _6 = _3 & _5;
  if (_6 != 0)
goto ;
  else
goto ;

  :
  if (t_2(D) == 0B)
goto ;
  else
goto ;

this is certainly jump-threadable. I am adding Jeff for this.

simplified testcase:
struct test {int a; int foo (int &b);};
int
test2 (test *t, int *q)
{
  if (t)
return t->a;
  else
return 1;
}
int test::foo(int &b)
{
  return test2(this,&b);
}

gets compiled as:
int test2(test*, int*) (struct test * t, int * q)
{
  int _1;
  int _4;

  :
  if (t_2(D) != 0B)
goto ;
  else
goto ;

  :
  if (t_2(D) == 0B)
goto ;
  else
goto ;

  :
  __builtin___ubsan_handle_type_mismatch (&*.Lubsan_data0, 0);

  :
  _4 = t_2(D)->a;

  :
  # _1 = PHI <_4(5), 1(2)>
  return _1;

}


so still no jump threading, but RTL gets it:
_Z5test2P4testPi:
.LFB0:
.cfi_startproc
testq   %rdi, %rdi
movl$1, %eax
je  .L2
movl(%rdi), %eax
.L2:

however test:foo is also compiled as:
_ZN4test3fooERi:
.LFB1:
.cfi_startproc
testq   %rdi, %rdi
movl$1, %eax
je  .L8
movl(%rdi), %eax
.L8:
rep ret

whic is wrong, it should complain about undefined behaviour for NULL this.


[Bug other/66179] New: Sub-optimal code generation with __attribute__((leaf))

2015-05-16 Thread mednafen at sent dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66179

Bug ID: 66179
   Summary: Sub-optimal code generation with __attribute__((leaf))
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mednafen at sent dot com
  Target Milestone: ---

Created attachment 35556
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35556&action=edit
C code which demonstrates the issue.

The attached code, when compiled like(for example):

gcc -fno-asynchronous-unwind-tables -O2 -S -o leaf.s -c leaf.c

(with 4.9.2 or 5.1.0, Linux x86_64)

produces bloated, sub-optimal assembly like:

test_call_leaf:
pushq   %r12
pushq   %rbp
pushq   %rbx
movla(%rip), %r12d
movlc(%rip), %ebx
callfunction_leaf
movlb(%rip), %ebp
addl$2, %r12d
addl$2, %ebx
movl%r12d, a(%rip)
callfunction_leaf
addl$2, %ebp
movl%ebx, c(%rip)
movl%ebp, b(%rip)
popq%rbx
popq%rbp
popq%r12
ret

compared to a more optimal possibility:

test_call_normal:
subq$8, %rsp
addl$2, a(%rip)
callfunction_normal
addl$2, b(%rip)
callfunction_normal
addl$2, c(%rip)
addq$8, %rsp
ret


[Bug other/66179] Sub-optimal code generation with __attribute__((leaf))

2015-05-16 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66179

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||alias, missed-optimization

--- Comment #1 from Andrew Pinski  ---
Related to bug 5739.