public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/40219]  New: iterative_hash_expr in tree.c has an out of bound reference for machine specific builtins
@ 2009-05-21 13:10 meissner at linux dot vnet dot ibm dot com
  2009-05-21 13:14 ` [Bug tree-optimization/40219] " meissner at linux dot vnet dot ibm dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: meissner at linux dot vnet dot ibm dot com @ 2009-05-21 13:10 UTC (permalink / raw)
  To: gcc-bugs

The function iterative_hash_expr uses built_in_decls to a map a builtin
function to the __builtin_ form.  It uses DECL_FUNCTION_CODE as the index.  For
machine specific builtins, the DECL_FUNCTION_CODE is defined by the backend,
instead of being the builtin number.  This means that the builtin_in_decls
reference can point to random memory.

In the power7 branch, I added quite a few more builtins, and this code causes
crashes when it looks at memory beyond the bound of builtin_in_decls.  Even if
it doesn't overflow the bounds of the array, the builtin hash might pick up the
wrong declaration.


-- 
           Summary: iterative_hash_expr in tree.c has an out of bound
                    reference for machine specific builtins
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: meissner at linux dot vnet dot ibm dot com
 GCC build triplet: powerpc64-unknown-linux-gnu
  GCC host triplet: powerpc64-unknown-linux-gnu
GCC target triplet: powerpc64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40219


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/40219] iterative_hash_expr in tree.c has an out of bound reference for machine specific builtins
  2009-05-21 13:10 [Bug tree-optimization/40219] New: iterative_hash_expr in tree.c has an out of bound reference for machine specific builtins meissner at linux dot vnet dot ibm dot com
@ 2009-05-21 13:14 ` meissner at linux dot vnet dot ibm dot com
  2009-05-22 21:51 ` meissner at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: meissner at linux dot vnet dot ibm dot com @ 2009-05-21 13:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from meissner at linux dot vnet dot ibm dot com  2009-05-21 13:14 -------
Created an attachment (id=17898)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17898&action=view)
Patch to avoid de-referencing outside array bounds

This patch fixes the particular problem I saw on the power7-branch for the
testsuite and building the SPEC2006 gobmk and wrf benchmarks.  I will do the
usual bootstrap shortly.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40219


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/40219] iterative_hash_expr in tree.c has an out of bound reference for machine specific builtins
  2009-05-21 13:10 [Bug tree-optimization/40219] New: iterative_hash_expr in tree.c has an out of bound reference for machine specific builtins meissner at linux dot vnet dot ibm dot com
  2009-05-21 13:14 ` [Bug tree-optimization/40219] " meissner at linux dot vnet dot ibm dot com
@ 2009-05-22 21:51 ` meissner at gcc dot gnu dot org
  2009-05-22 22:16 ` meissner at gcc dot gnu dot org
  2009-05-22 22:46 ` meissner at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: meissner at gcc dot gnu dot org @ 2009-05-22 21:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from meissner at gcc dot gnu dot org  2009-05-22 21:51 -------
Subject: Bug 40219

Author: meissner
Date: Fri May 22 21:51:12 2009
New Revision: 147807

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147807
Log:
Fix PR tree-optimization/40219

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40219


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/40219] iterative_hash_expr in tree.c has an out of bound reference for machine specific builtins
  2009-05-21 13:10 [Bug tree-optimization/40219] New: iterative_hash_expr in tree.c has an out of bound reference for machine specific builtins meissner at linux dot vnet dot ibm dot com
  2009-05-21 13:14 ` [Bug tree-optimization/40219] " meissner at linux dot vnet dot ibm dot com
  2009-05-22 21:51 ` meissner at gcc dot gnu dot org
@ 2009-05-22 22:16 ` meissner at gcc dot gnu dot org
  2009-05-22 22:46 ` meissner at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: meissner at gcc dot gnu dot org @ 2009-05-22 22:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from meissner at gcc dot gnu dot org  2009-05-22 22:09 -------
Created an attachment (id=17905)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17905&action=view)
This was the patch that was checked in.

Note, the original patch had the wrong ChangeLog.


-- 

meissner at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #17898|0                           |1
        is obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40219


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/40219] iterative_hash_expr in tree.c has an out of bound reference for machine specific builtins
  2009-05-21 13:10 [Bug tree-optimization/40219] New: iterative_hash_expr in tree.c has an out of bound reference for machine specific builtins meissner at linux dot vnet dot ibm dot com
                   ` (2 preceding siblings ...)
  2009-05-22 22:16 ` meissner at gcc dot gnu dot org
@ 2009-05-22 22:46 ` meissner at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: meissner at gcc dot gnu dot org @ 2009-05-22 22:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from meissner at gcc dot gnu dot org  2009-05-22 22:46 -------
Patch checked in svn revision 147806.


-- 

meissner at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40219


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-05-22 22:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-21 13:10 [Bug tree-optimization/40219] New: iterative_hash_expr in tree.c has an out of bound reference for machine specific builtins meissner at linux dot vnet dot ibm dot com
2009-05-21 13:14 ` [Bug tree-optimization/40219] " meissner at linux dot vnet dot ibm dot com
2009-05-22 21:51 ` meissner at gcc dot gnu dot org
2009-05-22 22:16 ` meissner at gcc dot gnu dot org
2009-05-22 22:46 ` meissner at gcc dot gnu dot org

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).