public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* error: BB 13 can not throw but has EH edges
@ 2008-04-15  2:50 Harald van Dijk
  2008-04-15 10:31 ` Brian Dessent
  0 siblings, 1 reply; 3+ messages in thread
From: Harald van Dijk @ 2008-04-15  2:50 UTC (permalink / raw)
  To: gcc-help

Hi all,

I was trying to get a program running with GCC 4.3.0, which mostly
failed due to missing #include directives, but after a bit I ran into a
strange error, which I tried to reduce and got to the below:

struct GList {
  void *data;
  GList *next;
};
struct GtkWidget gtk_dialog_get_type();
typedef struct _GtkTreeIter GtkTreeIter;
struct GtkTreePath;
struct GtkTreeModel;
unsigned gtk_tree_model_get_type() __attribute__((__const__));
int gtk_tree_model_get_iter(GtkTreeModel *tree_model, GtkTreePath *);
GtkWidget *gtk_tree_view_new_with_model (GtkTreeModel *);
namespace std {
  namespace __gnu_cxx {
    template <typename _Tp> class new_allocator {};
  }
  template <typename _Tp> class allocator :
__gnu_cxx::new_allocator<_Tp> {
  public:
    template <typename _Tp1> struct rebind {
      typedef allocator<_Tp1> other;
    };
    ~allocator () {}
  };
  template <typename> class basic_string;
  typedef basic_string<char> string;
  template <typename _Tp> struct _List_node;
  template <typename _Tp, typename _Alloc> class _List_base {
    typedef typename _Alloc::template rebind<_List_node<_Tp> >::other
_Node_alloc_type;
    _Node_alloc_type _M_impl;
  };
  template <typename _Tp, typename _Alloc = std::allocator<_Tp> > class
list : _List_base <_Tp, _Alloc> {};
}
class DictManageDlg {
  void show_add_dict_dialog (GtkTreeIter *);
};
void DictManageDlg::show_add_dict_dialog (GtkTreeIter *)
{
  std::list<std::string> added_dictlist;
  gtk_tree_view_new_with_model((GtkTreeModel *)
gtk_tree_model_get_type());
  {
    GList *selectlist;
    if (selectlist) {
      GList *list = selectlist;
      while (list) {
        gtk_tree_model_get_iter((GtkTreeModel *)
gtk_tree_model_get_type(), (GtkTreePath *) list->data);
        list = list->next;
      }
    }
  }
}

Apologies for the relatively long testcase, but I couldn't significantly
reduce it further. When compiling this with 'gcc -c -O bug.ii', I get:

bug.ii: In member function ‘void
DictManageDlg::show_add_dict_dialog(GtkTreeIter*)’:
bug.ii:35: error: BB 13 can not throw but has EH edges
bug.ii:35: internal compiler error: verify_flow_info failed
Please submit a full bug report,

I first ran into this with Gentoo's GCC 4.3.0, but I made sure to test
without any patches, and built official GCC configured with

../gcc-4.3.0/configure --prefix=$HOME/gcc --enable-languages=c,c++ \
	--enable-checking --build=i686-pc-linux-gnu

Now, I have a few questions:

- Is this a known issue? I've searched for this error, but only got
results requiring specific compiler options that aren't necessary to get
it to fail here. I will report it as a bug if it's not known (and not
already fixed by accident).

- When I disable checking, GCC does not generate any error message. Can
I expect that the code it generates will be correct, or might it be
broken and going undetected?

- What would you recommend as a workaround (other than disabling
checking)? My first guess would be to remove __attribute__((__const__)), but
that's not an option, as it's part of gtk, and not of the program
itself. Do you have a good alternative?

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

* Re: error: BB 13 can not throw but has EH edges
  2008-04-15  2:50 error: BB 13 can not throw but has EH edges Harald van Dijk
@ 2008-04-15 10:31 ` Brian Dessent
  2008-04-16  2:24   ` Harald van Dijk
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Dessent @ 2008-04-15 10:31 UTC (permalink / raw)
  To: Harald van D?k; +Cc: gcc-help

Harald van D?k wrote:

> - Is this a known issue? I've searched for this error, but only got
> results requiring specific compiler options that aren't necessary to get
> it to fail here. I will report it as a bug if it's not known (and not
> already fixed by accident).

This looks like <http://gcc.gnu.org/PR35261>.

> - When I disable checking, GCC does not generate any error message. Can
> I expect that the code it generates will be correct, or might it be
> broken and going undetected?

Disabling checking just papers over the real problem, which is an
internal inconsistency in gcc.  Whether or not the generated code is
correct is unknown.

> - What would you recommend as a workaround (other than disabling
> checking)? My first guess would be to remove __attribute__((__const__)), but
> that's not an option, as it's part of gtk, and not of the program
> itself. Do you have a good alternative?

I'd add your testcase to that PR above, at least.  You could also try
the current trunk and see if it's fixed there.

Brian

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

* Re: error: BB 13 can not throw but has EH edges
  2008-04-15 10:31 ` Brian Dessent
@ 2008-04-16  2:24   ` Harald van Dijk
  0 siblings, 0 replies; 3+ messages in thread
From: Harald van Dijk @ 2008-04-16  2:24 UTC (permalink / raw)
  To: gcc-help

On Mon, Apr 14, 2008 at 09:21:47PM -0700, Brian Dessent wrote:
> Harald van D?k wrote:
> 
> > - Is this a known issue? I've searched for this error, but only got
> > results requiring specific compiler options that aren't necessary to get
> > it to fail here. I will report it as a bug if it's not known (and not
> > already fixed by accident).
> 
> This looks like <http://gcc.gnu.org/PR35261>.
> 
> > - When I disable checking, GCC does not generate any error message. Can
> > I expect that the code it generates will be correct, or might it be
> > broken and going undetected?
> 
> Disabling checking just papers over the real problem, which is an
> internal inconsistency in gcc.  Whether or not the generated code is
> correct is unknown.

Yes, and that was what I was curious about: I was wondering whether the
optimiser is incorrect, or only the checks. If it turns out the checks
are incorrect, there's no reason for me to doubt the rest, but I'm not
at all familiar enough with GCC's structure to see what's going on.

> > - What would you recommend as a workaround (other than disabling
> > checking)? My first guess would be to remove __attribute__((__const__)), but
> > that's not an option, as it's part of gtk, and not of the program
> > itself. Do you have a good alternative?
> 
> I'd add your testcase to that PR above, at least.  You could also try
> the current trunk and see if it's fixed there.

Thanks, I've tried the most recent snapshots of 4.3 and 4.4, but they
both fail the same way. I've attached a testcase that's a bit shorter to
the bug.

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

end of thread, other threads:[~2008-04-15 19:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-15  2:50 error: BB 13 can not throw but has EH edges Harald van Dijk
2008-04-15 10:31 ` Brian Dessent
2008-04-16  2:24   ` Harald van Dijk

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