[committed] Introduce RTL function reader

Message ID yddo9zk9wwd.fsf@CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Jan. 6, 2017, 12:48 p.m.
Hi David,

> The various parts of patch 8 appear to now have been approved, so

> I've committed it (along with "Add ASSERT_RTX_PTR_EQ", which it

> requires and is required by) to trunk as r244110, having rebased,

> and bootstrapped & regrtested on x86_64-pc-linux-gnu, and tested

> stage 1's selftests for aarch64-linux-gnu.


this patch thoroughly broke bootstrap on every 32-bit target, it seems:

In file included from /vol/gcc/src/hg/trunk/local/gcc/read-rtl.c:31:0:
/vol/gcc/src/hg/trunk/local/gcc/read-rtl.c: In member function 'rtx_def* rtx_reader::read_rtx_code(const char*)':
/vol/gcc/src/hg/trunk/local/gcc/read-rtl.c:1260:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
       gcc_assert (idx < m_reuse_rtx_by_id.length ());
                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/vol/gcc/src/hg/trunk/local/gcc/system.h:731:14: note: in definition of macro 'gcc_assert'
    ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
              ^~~~

Seen on i386-pc-solaris2.*, sparc-sun-solaris2.*, and i686-pc-linux-gnu.

The following fix works for me, at least an i686-pc-linux-gnu bootstrap
is now into building target libraries.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2017-01-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* read-rtl.c (rtx_reader::read_rtx_code): Cast idx to unsigned.

Patch hide | download patch | download mbox

diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c
--- a/gcc/read-rtl.c
+++ b/gcc/read-rtl.c
@@ -1257,7 +1257,7 @@  rtx_reader::read_rtx_code (const char *c
       read_name (&name);
       long idx = atoi (name.string);
       /* Look it up by ID.  */
-      gcc_assert (idx < m_reuse_rtx_by_id.length ());
+      gcc_assert ((unsigned) idx < m_reuse_rtx_by_id.length ());
       return_rtx = m_reuse_rtx_by_id[idx];
       return return_rtx;
     }