diff options
author | Chris Manghane <cmang@google.com> | 2016-09-23 17:55:53 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-09-23 17:55:53 +0000 |
commit | fdbda43d03daa9e91ce1f88540c163fee8c0eab4 (patch) | |
tree | 78d05adfb0bfdec749bff8c96f435ba61e130657 /gcc | |
parent | e0535922dc32f753491e2f257e275006df251f49 (diff) | |
download | gcc-fdbda43d03daa9e91ce1f88540c163fee8c0eab4.zip gcc-fdbda43d03daa9e91ce1f88540c163fee8c0eab4.tar.gz gcc-fdbda43d03daa9e91ce1f88540c163fee8c0eab4.tar.bz2 |
re PR go/77701 (suspicious code in go/go-gcc.cc)
PR go/77701
* go-gcc.cc (Gcc_backend::Gcc_backend): Fix calls to integer_type
to pass arguments in the correct order.
From-SVN: r240451
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/go/go-gcc.cc | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index 16bc2b7..25e5274 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,9 @@ +2016-09-23 Chris Manghane <cmang@google.com> + + PR go/77701 + * go-gcc.cc (Gcc_backend::Gcc_backend): Fix calls to integer_type + to pass arguments in the correct order. + 2016-09-22 Ian Lance Taylor <iant@golang.org> * go-gcc.cc (Gcc_backend::Gcc_backend): Declare diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index f9ba9d5..57c2bee 100644 --- a/gcc/go/go-gcc.cc +++ b/gcc/go/go-gcc.cc @@ -651,25 +651,25 @@ Gcc_backend::Gcc_backend() { /* We need to define the fetch_and_add functions, since we use them for ++ and --. */ - tree t = this->integer_type(BITS_PER_UNIT, 1)->get_tree(); + tree t = this->integer_type(true, BITS_PER_UNIT)->get_tree(); tree p = build_pointer_type(build_qualified_type(t, TYPE_QUAL_VOLATILE)); this->define_builtin(BUILT_IN_SYNC_ADD_AND_FETCH_1, "__sync_fetch_and_add_1", NULL, build_function_type_list(t, p, t, NULL_TREE), false, false); - t = this->integer_type(BITS_PER_UNIT * 2, 1)->get_tree(); + t = this->integer_type(true, BITS_PER_UNIT * 2)->get_tree(); p = build_pointer_type(build_qualified_type(t, TYPE_QUAL_VOLATILE)); this->define_builtin(BUILT_IN_SYNC_ADD_AND_FETCH_2, "__sync_fetch_and_add_2", NULL, build_function_type_list(t, p, t, NULL_TREE), false, false); - t = this->integer_type(BITS_PER_UNIT * 4, 1)->get_tree(); + t = this->integer_type(true, BITS_PER_UNIT * 4)->get_tree(); p = build_pointer_type(build_qualified_type(t, TYPE_QUAL_VOLATILE)); this->define_builtin(BUILT_IN_SYNC_ADD_AND_FETCH_4, "__sync_fetch_and_add_4", NULL, build_function_type_list(t, p, t, NULL_TREE), false, false); - t = this->integer_type(BITS_PER_UNIT * 8, 1)->get_tree(); + t = this->integer_type(true, BITS_PER_UNIT * 8)->get_tree(); p = build_pointer_type(build_qualified_type(t, TYPE_QUAL_VOLATILE)); this->define_builtin(BUILT_IN_SYNC_ADD_AND_FETCH_8, "__sync_fetch_and_add_8", NULL, build_function_type_list(t, p, t, NULL_TREE), |