public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: gcc-patches@gcc.gnu.org
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>,
	Douglas Rupp <douglas.b.rupp@gmail.com>,
	Tristan Gingold <tgingold@free.fr>
Subject: [PATCH] PR target/55143: undefined reference to `c_default_pointer_mode'
Date: Thu, 09 Apr 2015 19:27:00 -0000	[thread overview]
Message-ID: <1428607654-16888-1-git-send-email-rep.dot.nop@gmail.com> (raw)

gcc/ChangeLog:

2015-04-08  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

	PR target/55143
	* c/c-tree.h (c_default_pointer_mode): Move declaration ...
	* c-family/c-common.h (c_default_pointer_mode): ... here.
	* c/c-decl.c (c_default_pointer_mode): Move definition ...
	* c-family/c-common.c (c_default_pointer_mode): ... here.

---

Ok for trunk?

Fixes all-gcc for ia64-hp-vms which previously failed with:

g++   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti \
  -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings \
  -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic \
  -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror \
  -fno-common  -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  -o cc1 \
  c/c-lang.o c-family/stub-objc.o attribs.o c/c-errors.o c/c-decl.o \
  c/c-typeck.o c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o \
  c/c-array-notation.o c-family/c-common.o c-family/c-cppbuiltin.o \
  c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o \
  c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o \
  c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o \
  c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-cilkplus.o \
  c-family/array-notation-common.o c-family/cilk.o c-family/c-ubsan.o \
  vms-c.o default-c.o \
          cc1-checksum.o libbackend.a main.o tree-browser.o libcommon-target.a \
  libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a \
  ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a \
  ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a \
   -L/obj.x86_64/gcc.config-list/ia64-hp-vms/./isl/.libs \
   -lisl -lmpc -lmpfr -lgmp -rdynamic -ldl  -L../zlib -lz
g++   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti \
  -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings \
  -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic \
  -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror \
  -fno-common  -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  -o cc1plus \
              cp/cp-lang.o c-family/stub-objc.o cp/call.o cp/decl.o cp/expr.o \
  cp/pt.o cp/typeck2.o cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parser.o \
  cp/ptree.o cp/rtti.o cp/typeck.o cp/cvt.o cp/except.o cp/friend.o cp/init.o \
  cp/method.o cp/search.o cp/semantics.o cp/tree.o cp/repo.o cp/dump.o \
  cp/optimize.o cp/mangle.o cp/cp-objcp-common.o cp/name-lookup.o \
  cp/cxx-pretty-print.o cp/cp-cilkplus.o cp/cp-gimplify.o \
  cp/cp-array-notation.o cp/lambda.o cp/vtable-class-hierarchy.o \
  cp/constexpr.o cp/cp-ubsan.o attribs.o incpath.o c-family/c-common.o \
  c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o \
  c-family/c-gimplify.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o \
  c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o \
  c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o \
  c-family/c-cilkplus.o c-family/array-notation-common.o c-family/cilk.o \
  c-family/c-ubsan.o vms-c.o default-c.o cc1plus-checksum.o libbackend.a \
  main.o tree-browser.o libcommon-target.a libcommon.a ../libcpp/libcpp.a \
  ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a \
  ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a \
  ../libdecnumber/libdecnumber.a  \
  -L/obj.x86_64/gcc.config-list/ia64-hp-vms/./isl/.libs \
  -lisl -lmpc -lmpfr -lgmp -rdynamic -ldl  -L../zlib -lz
vms-c.o: In function `handle_pragma_pointer_size(char const*)':
vms-c.c:(.text+0x5ad): undefined reference to `c_default_pointer_mode'
vms-c.c:(.text+0x5c2): undefined reference to `c_default_pointer_mode'
vms-c.c:(.text+0x5da): undefined reference to `c_default_pointer_mode'
vms-c.c:(.text+0x5f8): undefined reference to `c_default_pointer_mode'
vms-c.o: In function `vms_c_common_override_options()':
vms-c.c:(.text+0x9ec): undefined reference to `c_default_pointer_mode'
vms-c.o:vms-c.c:(.text+0xa02): more undefined references to `c_default_pointer_mode' follow
collect2: error: ld returned 1 exit status
make[2]: *** [cc1plus] Error 1
---
 gcc/c-family/c-common.c |    4 ++++
 gcc/c-family/c-common.h |    4 ++++
 gcc/c/c-decl.c          |    4 ----
 gcc/c/c-tree.h          |    4 ----
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 456c619..7fe7fa6 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -67,6 +67,10 @@ along with GCC; see the file COPYING3.  If not see
 
 cpp_reader *parse_in;		/* Declared in c-pragma.h.  */
 
+/* Mode used to build pointers (VOIDmode means ptr_mode).  */
+
+machine_mode c_default_pointer_mode = VOIDmode;
+
 /* The following symbols are subsumed in the c_global_trees array, and
    listed here individually for documentation purposes.
 
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 5b2c5ab..cabf452 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -358,6 +358,10 @@ struct c_common_resword
   const unsigned int disable   : 16;
 };
 
+/* Mode used to build pointers (VOIDmode means ptr_mode).  */
+
+extern machine_mode c_default_pointer_mode;
+
 /* Extra cpp_ttype values for C++.  */
 
 /* A token type for template-ids.  If a template-id is processed while
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index e1741f1..e28a294 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -168,10 +168,6 @@ static int warn_about_return_type;
 
 static bool undef_nested_function;
 
-/* Mode used to build pointers (VOIDmode means ptr_mode).  */
-
-machine_mode c_default_pointer_mode = VOIDmode;
-
 /* If non-zero, implicit "omp declare target" attribute is added into the
    attribute lists.  */
 int current_omp_declare_target_attribute;
diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h
index c879bc7..7a72665 100644
--- a/gcc/c/c-tree.h
+++ b/gcc/c/c-tree.h
@@ -671,10 +671,6 @@ extern int current_function_returns_null;
 
 extern int current_function_returns_abnormally;
 
-/* Mode used to build pointers (VOIDmode means ptr_mode).  */
-
-extern machine_mode c_default_pointer_mode;
-
 /* In c-decl.c */
 
 /* Tell the binding oracle what kind of binding we are looking for.  */
-- 
1.7.10.4

             reply	other threads:[~2015-04-09 19:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09 19:27 Bernhard Reutner-Fischer [this message]
2015-04-09 19:41 ` Jakub Jelinek
2015-04-09 19:57   ` Bernhard Reutner-Fischer
2015-04-09 20:09     ` Jakub Jelinek
2015-04-10  5:42       ` Tristan Gingold
2015-04-10  6:28         ` Jakub Jelinek
2015-04-10  7:56           ` Bernhard Reutner-Fischer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1428607654-16888-1-git-send-email-rep.dot.nop@gmail.com \
    --to=rep.dot.nop@gmail.com \
    --cc=douglas.b.rupp@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tgingold@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).