[Bug go/77701] suspicious code in go/go-gcc.cc

2016-09-22 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77701

Chris Manghane  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-09-22
 Ever confirmed|0   |1

--- Comment #1 from Chris Manghane  ---
Huh, I'm surprised that ever worked. The definition needs to stay as it is
since it is being used by the frontend correctly. I'll update the calls the
backend constructor.

[Bug go/67101] mprof.goc:408:5: error: calling ‘__builtin_frame_address’ with a nonzero argument is unsafe [-Werror=frame-address]

2015-08-03 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67101

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2015-08-03
   Assignee|ian at airs dot com|cmang at google dot com
 Ever confirmed|0   |1

--- Comment #1 from Chris Manghane cmang at google dot com ---
Hi, thanks for reporting this. This is being addressed in golang.org/cl/13063.


[Bug go/61204] gccgo: ICE in in fold_convert_loc [GoSmith]

2015-01-13 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61204

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Chris Manghane cmang at google dot com ---
Fixed in trunk and test case added to Go testsuite.


[Bug go/61265] gccgo: ICE in verify_gimple_in_seq [GoSmith]

2015-01-06 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61265

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Chris Manghane cmang at google dot com ---
Fixed and test added to Go testsuite.


[Bug go/61253] gccgo: spurious error: expected '-' or '=' [GoSmith]

2015-01-06 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61253

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Chris Manghane cmang at google dot com ---
Fixed and test added to Go testsuite.


[Bug go/61273] gccgo: ICE in Unsafe_type_conversion_expression::do_get_backend [GoSmith]

2015-01-06 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61273

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||cmang at google dot com
 Resolution|--- |FIXED

--- Comment #2 from Chris Manghane cmang at google dot com ---
Fixed and test added to Go testsuite.


[Bug go/61258] gccgo: assertion failure go-map-delete.c:37 [GoSmith]

2015-01-06 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61258

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Chris Manghane cmang at google dot com ---
Fixed and test added to Go testsuite.


[Bug go/61264] gccgo: ICE in __normal_iterator [GoSmith]

2015-01-06 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61264

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Chris Manghane cmang at google dot com ---
Fixed and test added to Go testsuite.


[Bug go/61255] gccgo: spurious error: argument 2 has incompatible type [GoSmith]

2015-01-06 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61255

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Chris Manghane cmang at google dot com ---
Fixed and test added to Go testsuite.


[Bug go/61254] gccgo: spurious error: slice end must be integer [GoSmith]

2015-01-06 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61254

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Chris Manghane cmang at google dot com ---
Fixed and test added to Go testsuite.


[Bug go/61248] gccgo: spurious error: too many arguments [GoSmith]

2015-01-06 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61248

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Chris Manghane cmang at google dot com ---
Fixed and test added to Go testsuite.


[Bug go/61244] gccgo: ICE in write_specific_type_functions [GoSmith]

2015-01-06 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61244

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Chris Manghane cmang at google dot com ---
Fixed and test added to Go testsuite.


[Bug go/61246] gccgo: ICE in do_determine_types [GoSmith]

2015-01-06 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61246

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Chris Manghane cmang at google dot com ---
Fixed and test added to Go testsuite.


[Bug go/61265] gccgo: ICE in verify_gimple_in_seq [GoSmith]

2014-12-17 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61265

--- Comment #2 from Chris Manghane cmang at google dot com ---
A slightly smaller program can reproduce this as well:

package main

var a = [1][0]int{B}[0]
var B = [0]int{}

func main() {}

This error occurs because in Gcc_backend::fill_in_array, the type of B, [0]int,
is represented using build_array_type(int, build_index_type(len - 1)), where
len is 0 in this case, giving it a range of [0:MAX_INT] where it should be
[0:0]. The following patch fixes this behavior:

Index: gcc/go/go-gcc.cc
==
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -887,9 +887,13 @@ Gcc_backend::fill_in_array(Btype* fill, Btype*
element_type,

   // build_index_type takes the maximum index, which is one less than
   // the length.
-  tree index_type_tree = build_index_type(fold_build2(MINUS_EXPR, sizetype,
-  length_tree,
-  size_one_node));
+  tree index_type_tree = NULL_TREE;
+  if (length_tree == size_zero_node)
+index_type_tree = build_index_type(size_zero_node);
+  else
+index_type_tree = build_index_type(fold_build2(MINUS_EXPR, sizetype,
+   length_tree,
+   size_one_node));

   tree fill_tree = fill-get_tree();
   TREE_TYPE(fill_tree) = element_type_tree;


[Bug go/61263] gccgo: fatal error: schedule: holding locks [GoSmith]

2014-12-17 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61263

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||cmang at google dot com
 Resolution|--- |FIXED
   Assignee|ian at airs dot com|cmang at google dot com

--- Comment #1 from Chris Manghane cmang at google dot com ---
Ran this one hundred thousand times with GOGC=0 and unmodified GOGC, could not
reproduce at all. Marking as resolved; this might have been fixed with other
various fixes to add type precision to heap.


[Bug go/61265] gccgo: ICE in verify_gimple_in_seq [GoSmith]

2014-12-17 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61265

--- Comment #3 from Chris Manghane cmang at google dot com ---
Sorry for the noise, responding with new information as I discover it.

The above patch doesn't really work (it fails a few tests) because this isn't a
problem with zero-sized array types, but rather a problem with zero-sized
elements in array types.

This same bug can be reproduced by

package main

var a = [1]struct{}{B}[0]
var B = struct{}{}

func main(){}

because struct{} is a zero-sized type and the backend implementation makes
assumptions about zero-sized globals for the linker. A better approach is to
just avoid constructing an array of zero-sized values and evaluate the
zero-valued expressions for their side effects. This is be done in
https://codereview.appspot.com/191970043/.


[Bug go/61322] gccgo: spurious incompatible type for field 2 in struct construction error [GoSmith]

2014-12-16 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61322

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

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

--- Comment #2 from Chris Manghane cmang at google dot com ---
(In reply to Chris Manghane from comment #1)
 I'm unable to reproduce this on gcc version 5.0.0 20141210 (experimental)
 (GCC).


[Bug go/61316] gccgo: spurious incompatible types in assignment error [GoSmith]

2014-12-16 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61316

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

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

--- Comment #2 from Chris Manghane cmang at google dot com ---
Fixed.


[Bug go/61264] gccgo: ICE in __normal_iterator [GoSmith]

2014-12-16 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61264

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-12-16
 CC||cmang at google dot com
   Assignee|ian at airs dot com|cmang at google dot com
 Ever confirmed|0   |1

--- Comment #1 from Chris Manghane cmang at google dot com ---
This can be reproduced with

package main
func main() {
struct{ f int }{}.f++
}

which isn't a valid program although it is a minimal case of the provided
reproducer.

Another (valid) way to produce this would be

package main
func main() {
map[int]int{}[0]++
}


[Bug go/61265] gccgo: ICE in verify_gimple_in_seq [GoSmith]

2014-12-16 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61265

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-12-17
 CC||cmang at google dot com
   Assignee|ian at airs dot com|cmang at google dot com
 Ever confirmed|0   |1

--- Comment #1 from Chris Manghane cmang at google dot com ---
This can be reproduced with a smaller program:

package main

var a = [1][0]int{B}[0]
var B = [][0]int{}[0]

func main() {}


[Bug go/61255] gccgo: spurious error: argument 2 has incompatible type [GoSmith]

2014-12-15 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61255

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-12-15
 CC||cmang at google dot com
   Assignee|ian at airs dot com|cmang at google dot com
 Ever confirmed|0   |1


[Bug go/61307] gccgo: ICE in Create_function_descriptors::expression [GoSmith]

2014-12-12 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61307

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

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

--- Comment #2 from Chris Manghane cmang at google dot com ---
Unable to resolve.


[Bug go/61244] gccgo: ICE in write_specific_type_functions [GoSmith]

2014-12-12 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61244

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-12-12
 CC||cmang at google dot com
   Assignee|ian at airs dot com|cmang at google dot com
 Ever confirmed|0   |1

--- Comment #1 from Chris Manghane cmang at google dot com ---
This can reproduced with a smaller program:

package main
function main() {
switch i := (interface{})(0); i.(type) {
case [0]string:
}
}


[Bug go/61248] gccgo: spurious error: too many arguments [GoSmith]

2014-12-12 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61248

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-12-12
 CC||cmang at google dot com
   Assignee|ian at airs dot com|cmang at google dot com
 Ever confirmed|0   |1


[Bug go/61205] gccgo: ICE in fold_binary_loc [GoSmith]

2014-12-12 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61205

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||cmang at google dot com
 Resolution|--- |FIXED

--- Comment #1 from Chris Manghane cmang at google dot com ---
Unable to reproduce on tip.


[Bug go/61244] gccgo: ICE in write_specific_type_functions [GoSmith]

2014-12-12 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61244

--- Comment #3 from Chris Manghane cmang at google dot com ---
I plan to add the test cases that GoSmith uncovered once the remaining GoSmith
issues are resolved since it's possible some of them might overlap.


[Bug go/61253] gccgo: spurious error: expected '-' or '=' [GoSmith]

2014-12-12 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61253

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-12-12
 CC||cmang at google dot com
   Assignee|ian at airs dot com|cmang at google dot com
 Ever confirmed|0   |1


[Bug go/61254] gccgo: spurious error: slice end must be integer [GoSmith]

2014-12-12 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61254

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-12-12
 CC||cmang at google dot com
   Assignee|ian at airs dot com|cmang at google dot com
 Ever confirmed|0   |1


[Bug go/61226] gccgo: hangs in sort_var_inits [GoSmith]

2014-12-10 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61226

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||cmang at google dot com
 Resolution|--- |FIXED

--- Comment #1 from Chris Manghane cmang at google dot com ---
Fixed in
https://code.google.com/p/gofrontend/source/detail?r=96de84075614dd56f47b185977c51d3da147c6a7.


[Bug go/61204] gccgo: ICE in in fold_convert_loc [GoSmith]

2014-12-10 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61204

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-12-10
 CC||cmang at google dot com
 Ever confirmed|0   |1

--- Comment #1 from Chris Manghane cmang at google dot com ---
This smaller version of this program is:

package main
func main() {
type t [0]int
var v t
v, _ = [0]int{}, 0
_ = v
}

which fails because [0]int is a zero-sized type and the temporary variable for
that holds [0]int{} cannot be initialized. This patch avoids initializing
zero-sized temporaries:



Index: gcc/go/go-gcc.cc
==
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -2505,7 +2505,7 @@ Gcc_backend::temporary_variable(Bfunction* function,
Bblock* bblock,
   BIND_EXPR_VARS(bind_tree) = BLOCK_VARS(block_tree);
 }

-  if (init_tree != NULL_TREE)
+  if (this-type_size(btype) != 0  init_tree != NULL_TREE)
 DECL_INITIAL(var) = fold_convert_loc(location.gcc_location(), type_tree,
  init_tree);


[Bug go/61246] gccgo: ICE in do_determine_types [GoSmith]

2014-12-10 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61246

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-12-10
 CC||cmang at google dot com
   Assignee|ian at airs dot com|cmang at google dot com
 Ever confirmed|0   |1

--- Comment #2 from Chris Manghane cmang at google dot com ---
This ICE can reproduced by a smaller program:

package main
func main() {
switch 1 != 1 {
default:
}
}


[Bug go/61258] gccgo: assertion failure go-map-delete.c:37 [GoSmith]

2014-12-10 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61258

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-12-10
 CC||cmang at google dot com
   Assignee|ian at airs dot com|cmang at google dot com
 Ever confirmed|0   |1


[Bug go/61322] gccgo: spurious incompatible type for field 2 in struct construction error [GoSmith]

2014-12-09 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61322

--- Comment #1 from Chris Manghane cmang at google dot com ---
I'm unable to reproduce this on gcc version 5.0.0 20141210 (experimental)
(GCC).


[Bug go/61307] gccgo: ICE in Create_function_descriptors::expression [GoSmith]

2014-12-09 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61307

--- Comment #1 from Chris Manghane cmang at google dot com ---
I'm unable to reproduce this on gcc version 5.0.0 20141210 (experimental)
(GCC).