public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug jit/66779] New: jit segfault
@ 2015-07-06 14:16 dmalcolm at gcc dot gnu.org
  2015-07-06 16:07 ` [Bug jit/66779] " dmalcolm at gcc dot gnu.org
  2015-07-07 19:22 ` dmalcolm at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2015-07-06 14:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66779

            Bug ID: 66779
           Summary: jit segfault
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: jit
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
            Blocks: 66627
  Target Milestone: ---

This bug is to track the segfault during jit-compilation reported here:
  https://gcc.gnu.org/ml/jit/2015-q3/msg00018.html

I'm able to reproduce it locally on x86_64 with trunk using the reproducer
attached to that mail.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66627
[Bug 66627] Tracker bug for jit bugs affecting ravi


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

* [Bug jit/66779] jit segfault
  2015-07-06 14:16 [Bug jit/66779] New: jit segfault dmalcolm at gcc dot gnu.org
@ 2015-07-06 16:07 ` dmalcolm at gcc dot gnu.org
  2015-07-07 19:22 ` dmalcolm at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2015-07-06 16:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66779

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-07-06
     Ever confirmed|0                           |1

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Root cause is here (in expr.c):
11035             tree type = lang_hooks.types.type_for_mode (mode, unsignedp);
where the langhook returns NULL, leading to a segfault.

11034             enum tree_code tcode = code == NE ? NE_EXPR : EQ_EXPR;
11035             tree type = lang_hooks.types.type_for_mode (mode, unsignedp);
11036             tree temp = fold_build2_loc (loc, BIT_AND_EXPR, TREE_TYPE
(arg1),
11037                                          gimple_assign_rhs1 (srcstmt),
11038                                          gimple_assign_rhs2 (srcstmt));
11039             temp = fold_single_bit_test (loc, tcode, temp, arg1, type);

(gdb) p mode
$2 = QImode
(gdb) p unsignedp
$3 = 0

Guarded by:
11031         if (srcstmt
11032             && integer_pow2p (gimple_assign_rhs2 (srcstmt)))

Fix is to handle the missing modes in jit_langhook_type_for_mode.


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

* [Bug jit/66779] jit segfault
  2015-07-06 14:16 [Bug jit/66779] New: jit segfault dmalcolm at gcc dot gnu.org
  2015-07-06 16:07 ` [Bug jit/66779] " dmalcolm at gcc dot gnu.org
@ 2015-07-07 19:22 ` dmalcolm at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2015-07-07 19:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66779

--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Author: dmalcolm
Date: Tue Jul  7 19:22:01 2015
New Revision: 225522

URL: https://gcc.gnu.org/viewcvs?rev=225522&root=gcc&view=rev
Log:
PR jit/66779: fix segfault

gcc/jit/ChangeLog:
        PR jit/66779
        * dummy-frontend.c (jit_langhook_type_for_mode): Ensure that we
        handle modes QI, HI, SI, DI, TI.

gcc/testsuite/ChangeLog:
        PR jit/66779
        * jit.dg/all-non-failing-tests.h: Add test-pr66779.c.
        * jit.dg/test-pr66779.c: New testcase.

Added:
    trunk/gcc/testsuite/jit.dg/test-pr66779.c
Modified:
    trunk/gcc/jit/ChangeLog
    trunk/gcc/jit/dummy-frontend.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/jit.dg/all-non-failing-tests.h


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

end of thread, other threads:[~2015-07-07 19:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-06 14:16 [Bug jit/66779] New: jit segfault dmalcolm at gcc dot gnu.org
2015-07-06 16:07 ` [Bug jit/66779] " dmalcolm at gcc dot gnu.org
2015-07-07 19:22 ` dmalcolm at gcc dot gnu.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).